<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>智能养殖远程管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <!-- <link rel="shortcut icon" href="../logo.png" /> -->
    <link rel="stylesheet" href="../plugins/layui/css/layui.css?v=${.Config.basic.version}" media="all">
    <link rel="stylesheet" href="../plugins/layui/css/style.css?v=${.Config.basic.version}" media="all">
    <link rel="stylesheet" href="../layuiadmin/style/admin.css?v=${.Config.basic.version}" media="all">
    <link rel="stylesheet" href="../plugins/zTree/css/metroStyle/metroStyle.css?v=${.Config.basic.version}">
    <link rel="stylesheet" href="../plugins/zTree/css/metroStyle/ext.css?v=${.Config.basic.version}">
    <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3564966_a6tt4yhnzge.css" media="all">
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?v=${.Config.basic.version}">
    <style>
        .layui-btn {
            background-color: #37384d;
        }
        .layui-form-item .layui-input-inline {
            float: left;
            width: 130px;
            margin-right: 10px;
        }
        .layui-form-item {
            margin-top: 5px;
            margin-bottom: 5px;
        }

        .layui-btn + .layui-btn {
            margin-left: 5px;
        }
        .layui-btn-xs {
            height: 18px;
            line-height: 18px;
            padding: 0 5px;
            font-size: 11px;
        }

        .layui-form-label-lg {
            float: left;
            display: block;
            padding: 9px 15px;
            width: 150px;
            font-weight: 400;
            line-height: 20px;
            text-align: right;
        }

        /*.layui-form-item .layui-input[readonly] {*/
        /*    background-color: #0a1434;*/
        /*    color: #a6b8d5;*/
        /*    border: none;*/
        /*    border-top-color: currentcolor;*/
        /*    border-right-color: currentcolor;*/
        /*    border-bottom-color: currentcolor;*/
        /*    border-left-color: currentcolor;*/
        /*}*/
        .layui-btn-normal {
            background-color: transparent;
        }
    </style>

    <style>
        .layui-table-view .layui-table td, .layui-table-view .layui-table th {
            padding: 5px 0;
            border-top: 1px solid #404453;
            border-left: 1px solid #404453;
            border-bottom: 1px solid #404453;
            border-right: 1px solid #404453;
        }
        .layui-table tbody tr:hover, .layui-table thead tr, .layui-table-header, .layui-table-hover, .layui-table-mend, .layui-table-patch, .layui-table-total, .layui-table-total tr, .layui-table[lay-even] tr:nth-child(2n) {
            background-color: transparent !important;
        }
        .layui-table[lay-size="sm"] td, .layui-table[lay-size="sm"] th {
            font-size: 12px;
            padding: 2px 2px;
        }
        .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin="line"], .layui-table[lay-skin="row"] {
            border-width: 1px;
            border-style: solid;
            border-color: #000;
        }
        .layui-table {
            width: auto !important;
            background-color: #eee;
            /* color: #899eb2; */
        }
        [v-clock]{
            display: none;
        }

        .style-select{
            height: 34px;
            line-height: 34px;
            background-color: #fff;
            color: #8f97b3;
            border-radius: 5px;
            border: 0px solid #6c7492;
        }
        
    </style>
    <style>
        /*以下修改layui 时间范围选择器去掉秒显示的样式*/
        .layui-laydate-content>.layui-laydate-list {padding-bottom: 0px;overflow: hidden }
        .layui-laydate-content>.layui-laydate-list>li {width:50%}
        .merge-box .scrollbox .merge-list {
            padding-bottom:5px;
        }
        .laydate-time-list li {width:100%;padding-left:0;text-align: center};
        </style>
</head>
<body class="layui-layout-body">
    <div class="">
        <div style="display: flex;">
            <div style="width: 250px; ">
                <div class="tree-div pd-md" >
                    <ul id="tree" class="ztree"></ul>
                </div>
            </div>

            <div style="width: calc(100% - 250px);float: right; " >
                <div class="right pd-md">
                    <form  class="para layui-form" style="display: none;" id="form_param" lay-filter="form_param">
                        <div class="content-scroll bg-panel" >
                            <div class="panel-header">
                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">终端参数</span>

                                    <!-- <button type="button" @click="onSaveGroup();" class="action-edit layui-hide  radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 保存数据项</button> -->
                                    <!-- <button type="button" @click="onExport();" class="action-edit radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-download-circle layui-text-white mr-sm"></i> 导出</button> -->
                                    <!-- <button type="button" @click="onAddGroup();" class="action-edit layui-hide  radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-add-1 layui-text-white mr-sm"></i> 增加组</button> -->
                                </span>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">终端地址</label>
                                    <div class="layui-input-inline">
                                        <input type="text" readonly placeholder="" name="Addr" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">通信模式</label>
                                    <div class="layui-input-inline">
                                        <!--<input type="checkbox" name="ComType" checked="" lay-skin="switch" lay-text="开启|关闭" >-->
                                        <select  name="ComType" lay-filter="ComType" lay-verify="required" lay-search=""  >
                                            <option value="0">以太网</option>
                                            <option value="1">移动</option>
                                            <option value="2">联通</option>
                                            <option value="3">电信</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">服务器IP</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Sip" lay-verify="verify_ip" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">服务器端口</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Port" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">终端地址</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Gw" lay-verify="verify_ip" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">子网掩码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Msk" lay-verify="verify_ip" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">自动分配地址</label>
                                    <div class="layui-input-inline">
                                        <input type="checkbox" name="Dhcp" checked="" lay-skin="switch" lay-text="自动|手动" >
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">本地IP</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Lip" lay-verify="verify_ip" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">APN</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Apn" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">APN用户名</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="User" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">APN密码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="Pass" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                            </div>
 

                            <div class="layui-form-item layui-hide">
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg"></label>
                                    <div class="layui-input-inline">
                                        <input type="button" class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="btn_save_param" id="btn_save_param" value="保存终端参数">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="content-scroll bg-panel" >
                            <div class="panel-header">
                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">额外参数</span>
                                </span>
                            </div>

                            <div class="layui-form-item">

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">限制子设备数量</label>
                                    <div class="layui-input-inline">
                                        <input type="checkbox" name="EnMaxNode" checked="" lay-skin="switch" lay-text="是|否" >
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">最大子设备数</label>
                                    <div class="layui-input-inline">
                                        <input type="text" oninput="validate_int(0,100,event)" placeholder="1-100" name="MaxNode" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">场区名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="SiteName" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label-lg layui-form-label-sm">单元名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" placeholder="" name="HouseName" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <button type="button" lay-submit lay-filter="btn_auto_name" class="action-edit layui-hide  radius-10 layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 自动填写</button>
                                </div>
                                

                            </div>

                            <div class="layui-form-item layui-hide">
                                <div class="layui-inline">
                                    <label class="layui-form-label-lg"></label>
                                    <div class="layui-input-inline">
                                        <input type="button" class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="btn_save_exparam" id="btn_save_exparam" value="保存终端额外参数">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </form>

                    <div class="node_para" style="display: none;" v-clock>
                        <!-- <blockquote class="layui-elem-quote"><span>请选择饲喂器</span></blockquote> -->

                        <div class="bg-panel">
                            <div class="panel-header">

                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">基本参数</span>
                                </span>
                                <!-- <span onclick="onSaveLgNode()" class=" fr hand layui-text-sm layui-text-mute radius" style="margin: 5px;"><i class="layui-icon close-btn layui-icon-download-circle layui-text-green mr-sm"></i></span> -->
                            </div>

                            <form  class="layui-form" id="form_node_param" lay-filter="form_node_param">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">是否启用</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|关闭" name="_Enable">
                                        </div>
                                    </div>
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">SN序列号</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Sn" maxlength="8" placeholder="10位SN序列号" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">密码</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Passwd" maxlength="6" placeholder="密码" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">栏位编号</label>
                                        <div class="layui-input-inline" style="margin-right: 0px;width: 80px">
                                            <input type="text" v-model="node_para.Hnum" id="Hnum" maxlength="5" placeholder="AXXX" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                        <label class="layui-form-label-sm" onclick="autoCreateHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-help layui-text-orange"></i></label>
                                        <label class="layui-form-label-sm" onclick="onSetHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-release layui-text-orange"></i></label>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">日龄</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Gday" maxlength="3" @input="validate_int(0,999,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">模式</label>
                                        <div class="layui-input-inline">
                                            <!-- <select lay-ignore  v-model="node_para.Mode" name="Mode" lay-filter="Mode" lay-verify="required" lay-search=""  >
                                                <option value="0">停用</option>
                                                <option value="1">妊娠</option>
                                                <option value="2">哺乳</option>
                                                <option value="3">保育</option>
                                                <option value="4">育肥</option>
                                                <option value="5">定时下料</option>
                                            </select> -->
                                            <select name="Mode" id="Mode" lay-filter="Mode" lay-verify="required" lay-search=""  >
                                                <option value="0">停用</option>
                                                <option value="1">妊娠</option>
                                                <option value="2">哺乳</option>
                                                <option value="3">保育</option>
                                                <option value="4">育肥</option>
                                                <option value="5">定时下料</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">有余料AD值</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.CalAD" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">无余料AD值</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.CalADR" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">10圈出料(g)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.CalFeed" placeholder="" @input="validate_int(1,9999,event)" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">1L水对应的脉冲数</label>
                                        <div class="layui-input-inline">
                                            <!-- <input type="text" v-model="node_para.PulseWater" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input"> -->
                                            <select lay-ignore style="height: 34px;
                                            width: 130px;
                                            background-color: #fff;
                                            color: #8f97b3;
                                            border: 0px;
                                            border-radius: 5px;"  v-model="node_para.PulseWater"   >
                                                <option  value="520">520</option>
                                                <option  value="1200">1200</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="model==168">
                                        <label class="layui-form-label-lg layui-form-label-sm">电机1圈脉冲数</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.PulseFeed" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">水阀</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnWater">
                                        </div>
                                    </div>
        
                                    <div class="layui-inline " v-show="mode!=3 && mode!=4 && mode!=5 && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">触碰杆</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnTB" lay-filter="_EnTB">
                                        </div>
                                    </div>
        
                                    <!-- <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">反转次数</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ReverseTimes" placeholder="1-10" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">反转圈数</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ReverseTurns" placeholder="1.0-10.0" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div> -->

                                    <div class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">延时下水时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="下料开始多少秒后开始下水" lay-offset="0"></i></label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.WaterDelay" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">下料/水保护延长时间(分)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.PtTimeDelay" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

        
                                    <!-- <div class="layui-inline" v-show="1==1">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出料(g)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManOut" @input="validate_int(0,500,event)" placeholder="≤500" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div> -->
                                    <div class="layui-inline" v-show="model==168">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出料(g)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManOut" @input="validate_int(0,1000,event)" placeholder="≤1000" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="model!=168">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出料(g)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManOut" @input="validate_int(0,500,event)" placeholder="≤500" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <!-- <div class="layui-inline" v-show="1==1">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出水(ml)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManWaterOut" @input="validate_int(0,1000,event)" placeholder="≤1000" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div> -->

                                    <div class="layui-inline" v-show="model==168">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出水(ml)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManWaterOut" @input="validate_int(0,1000,event)" placeholder="≤1000" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="model!=168">
                                        <label class="layui-form-label-lg layui-form-label-sm">手动出水(ml)</label>
                                        <div class="layui-input-inline">
                                            <input type="text"  v-model="node_para.ManWaterOut" @input="validate_int(0,500,event)" placeholder="500" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    
        
                                    <div class="layui-inline" v-show="(mode==1||mode==2) && enTB && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 无触碰超时(分)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Mr_notbTo" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 强制出水(L) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="采食结束后强制出水量" lay-offset="0"></i></label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Mr_forceWater" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 清槽时间(分)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.Mr_clearTO" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <!-- <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">300g 触碰杆保护时间(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.TbPTime[0]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">500g 触碰杆保护时间(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.TbPTime[1]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">1kg 触碰杆保护时间(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.TbPTime[2]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div> -->
        
                                    <div class="layui-inline" v-show="(mode==1||mode==2) ">
                                        <label class="layui-form-label-lg layui-form-label-sm">提前退出补水时间(分) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="差多少分钟到饲喂时段就不补水" lay-offset="0"></i></label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.CwExitTime" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div class="layui-inline" v-show="(mode==1||mode==2||mode==3||mode==4) && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">水阀没脉冲保护时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="水阀在多久没有感应到脉冲或者不足就报警(水压不足或者脉冲坏)" lay-offset="0"></i></label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.WaterPTTO" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="mode==3">
                                        <label class="layui-form-label-lg layui-form-label-sm">保育自动切换育肥</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnAutoSwitchGrowthMode" lay-filter="_EnAutoSwitchGrowthMode">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">首次触碰当诱食处理</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnFirstTouchAsFirstFeed">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="1==1">
                                        <label class="layui-form-label-lg layui-form-label-sm">电机过流保护</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnMotorCurProtect">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">电机空载检测</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnMotorCurIdle">
                                        </div>
                                    </div>

                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">空载电流(mA)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.CurIdle" placeholder="1-255" maxlength="3" @input="validate_int(1,255,event)" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
        
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">增加减少饲喂量 <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="饲喂量偏移量，可以为正负值" lay-offset="0"></i></label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_para.FeedOffset" maxlength="2" @input="validate_int(-5,5,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                        <label class="layui-form-label layui-form-label-xs">x100g</label>
                                    </div>

                                    

                                </div>
                            </form>
                            
                        </div>

                        <div class="plan" >

                            <div v-show="mode==1" class="bg-panel mr-top-md" >
                                <div class="panel-header pd-md">
                                    <span class="panel-title ">
                                        <span class="layui-badge-dot layui-bg-olive"></span> 
                                        <span class="layui-text-xs ">妊娠方案参数</span>
    
                                        <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                        
                                        
                                        <!-- <button type="button" @click="onAddGroup();" class="action-edit layui-hide  radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-add-1 layui-text-white mr-sm"></i> 增加组</button> -->
                                    </span>
                                </div>
                                <div class="mr-md" style="overflow: auto;">
                                    <table class="layui-table" lay-size="sm">
                                        <colgroup>
                                            <col width="40">
                                            <col width="50">
                                            <col width="40">
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="40" v-show="enTB && is_admin">
                                            <col width="40" v-show="enTB && is_admin" >
                                            <col width="40" v-show="enTB && is_admin">
                                            <col width="40" v-show="is_admin">
                                            <col width="40" v-show="is_admin">
                                            <col width="40" v-show="!enTB && is_admin">
                                            <col width="40" v-show="!enTB && is_admin">
        
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th class="center" colspan="1" rowspan="3">日龄</th>
                                                <th class="center" colspan="1" rowspan="3">日总料量</th>
                                                <th class="center" colspan="1" rowspan="3">水料比</th>
                                                <th class="center" colspan="1" rowspan="3">餐数</th>
        
                                                <th class="center"  colspan="18" rowspan="1">每餐下料(下料单位kg)</th>
                                                <!-- <th class="center" v-else colspan="12" rowspan="1">每餐下料(下料单位kg)</th> -->
        
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次触碰下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">触碰下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="is_admin">
                                                    下水保护时间 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3" v-show="is_admin">单次补水量(L)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="!enTB && is_admin">单次下料量(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="!enTB && is_admin">自动出料保护时间(分)</th>
        
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料是否下水</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">整个时间段内未主动有效触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">15分钟未触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">智能未触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">吃完退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次补水强制出水</th>
        
                                                <th class="center" colspan="1" rowspan="3">重置</th>
                                                
                                                <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                            </tr>
        
                                            <tr>
                                                <th class="center" colspan="3" rowspan="1">第1餐</th>
                                                <th class="center" colspan="3" rowspan="1">第2餐</th>
                                                <th class="center" colspan="3" rowspan="1">第3餐</th>
                                                <th class="center" colspan="3" rowspan="1">第4餐</th>
                                                <th class="center" colspan="3" rowspan="1">第5餐</th>
                                                <th class="center" colspan="3" rowspan="1">第6餐</th>
                                            </tr>
        
                                            <tr>
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
                                            </tr>
        
                                            
                                        </thead>
                                        <tbody>
                                            <form  class="layui-form" id="form_pg_param" lay-filter="form_pg_param">
                                                <template  v-for="(item,idx) in Pg_para">
                                                    <tr>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_gday" @input="on_Pg_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_total_feed>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_waterFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
        
                                                        <td>
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Pg_time[0]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits0">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[0]"  @input="onPg_outT(idx,0,event)"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        
        
        
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Pg_time[1]" v-model="item.Pg_time[1]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits1">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[1]" @input="onPg_outT(idx,1,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        
        
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Pg_time[2]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits2">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[2]" @input="onPg_outT(idx,2,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        
        
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Pg_time[3]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits3">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[3]" @input="onPg_outT(idx,3,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        
        
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Pg_time[4]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits4">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[4]" @input="onPg_outT(idx,4,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                            </div>
                                                        </td>
                                                        
        
                                                        <td>
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" :id="'Pg_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Pg_time[5]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input Pg_time" :class="item.Pg_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                            </div>
                                                        </td>
                                                        <td >
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_rev_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits5">
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_outT[5]" @input="onPg_outT(idx,5,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input" :class="item.Pg_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                            </div>
                                                        </td>
                                                        
        
                                                        <td v-show="enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_firstFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_ftbFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_tbFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_wgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_cw" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="!enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_autoFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="!enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="text" v-model="item.Pg_fgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                    class="layui-input"  style="width: 40px;">
                                                            </div>
                                                        </td>
        
                                                        <td v-show="enTB && is_admin">
                                                            <div  class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit0">
                                                            </div>
                                                        </td>
                                                        <td v-show="enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[1]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit1">
                                                            </div>
                                                        </td>
                                                        <td v-show="enTB && is_admin">
                                                            <div  class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[2]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit2">
                                                            </div>
                                                        </td>
                                                        <td v-show="enTB && is_admin">
                                                            <div class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[3]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit3">
                                                            </div>
                                                        </td>
                                                        <td v-show="enTB && is_admin">
                                                            <div  class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[4]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit4">
                                                            </div>
                                                        </td>
                                                        <td v-show="enTB && is_admin">
                                                            <div  class="layui-input-inline" style="width: 100%;">
                                                                <input type="checkbox" v-model="item.Pg_flag_bits[5]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit5">
                                                            </div>
                                                        </td>
        
                                                        <td >
                                                            <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class=" text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange mr-sm"></i></span>
                                                            <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10 fr mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                            
                                                        </td>
                                                    </tr>
                                                </template>
                                            </form>
                                            
                                            
                                            
                                        </tbody>
                                    </table>
                                </div>

                                
                            </div>

                            <div v-show="mode==2" class="bg-panel mr-top-md">
                                <div class="panel-header pd-md">
                                    <span class="panel-title ">
                                        <span class="layui-badge-dot layui-bg-olive"></span> 
                                        <span class="layui-text-xs ">哺乳方案参数</span>
    
                                        <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                        
                                    </span>
                                </div>

                                <div class="mr-md" style="overflow: auto;">
                                    <table class="layui-table" lay-size="sm">
                                        <colgroup>
                                            <col width="40">
                                            <col width="50">
                                            <col width="40">
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="90">
                                            <col width="40" >
                                            <col width="40">
        
                                            <col width="40" v-show="enTB && is_admin">
                                            <col width="40" v-show="enTB && is_admin" >
                                            <col width="40" v-show="enTB && is_admin">
                                            <col width="40" v-show="is_admin">
                                            <col width="40" v-show="is_admin">
                                            <col width="40" v-show="!enTB && is_admin">
                                            <col width="40" v-show="!enTB && is_admin">
        
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                            <col width="60" v-show="enTB && is_admin">
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th class="center" colspan="1" rowspan="3">日龄</th>
                                                <th class="center" colspan="1" rowspan="3">日总料量</th>
                                                <th class="center" colspan="1" rowspan="3">水料比</th>
                                                <th class="center" colspan="1" rowspan="3">餐数</th>
        
                                                <th class="center"  colspan="18" rowspan="1">每餐下料(下料单位kg)</th>
                                                <!-- <th class="center" v-else colspan="12" rowspan="1">每餐下料(下料单位kg)</th> -->
        
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次触碰下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">触碰下料(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="is_admin">
                                                    下水保护时间 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3" v-show="is_admin">单次补水量(L)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="!enTB && is_admin">单次下料量(kg)</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="!enTB && is_admin">自动出料保护时间(分)</th>
        
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料是否下水</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">整个时间段内未主动有效触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">15分钟未触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">智能未触碰退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">吃完退出</th>
                                                <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次补水强制出水</th>
        
                                                <th class="center" colspan="1" rowspan="3">重置</th>
                                                
                                                <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                            </tr>
        
                                            <tr>
                                                <th class="center" colspan="3" rowspan="1">第1餐</th>
                                                <th class="center" colspan="3" rowspan="1">第2餐</th>
                                                <th class="center" colspan="3" rowspan="1">第3餐</th>
                                                <th class="center" colspan="3" rowspan="1">第4餐</th>
                                                <th class="center" colspan="3" rowspan="1">第5餐</th>
                                                <th class="center" colspan="3" rowspan="1">第6餐</th>
                                            </tr>
        
                                            <tr>
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
        
                                                <th class="center">时间</th>
                                                <th class="center" >诱食</th>
                                                <th class="center">下料</th>
                                                
                                            </tr>
        
                                            
                                        </thead>

                                        <tbody>
                                            <template  v-for="(item,idx) in La_para">
                                                <tr>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_gday" @input="on_La_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_total_feed>0?'layui-input-green':''" style="width: 50px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_waterFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.La_time[0]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits0">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[0]" @input="onLa_outT(idx,0,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    
    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.La_time[1]" v-model="item.La_time[1]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits1">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[1]" @input="onLa_outT(idx,1,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.La_time[2]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits2">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[2]" @input="onLa_outT(idx,2,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.La_time[3]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits3">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[3]" @input="onLa_outT(idx,3,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.La_time[4]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits4">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[4]" @input="onLa_outT(idx,4,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'La_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.La_time[5]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input La_time" :class="item.La_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_rev_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits5">
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_outT[5]" @input="onLa_outT(idx,5,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.La_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                        </div>
                                                    </td>
                                                    
    
                                                    <td v-show="enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_firstFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_ftbFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_tbFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_wgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_cw" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="!enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_autoFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>
    
                                                    <td v-show="!enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.La_fgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 40px;">
                                                        </div>
                                                    </td>

                                                    <td v-show="enTB && is_admin">
                                                        <div  class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit0">
                                                        </div>
                                                    </td>
                                                    <td v-show="enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[1]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit1">
                                                        </div>
                                                    </td>
                                                    <td v-show="enTB && is_admin">
                                                        <div  class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[2]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit2">
                                                        </div>
                                                    </td>
                                                    <td v-show="enTB && is_admin">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[3]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit3">
                                                        </div>
                                                    </td>
                                                    <td v-show="enTB && is_admin">
                                                        <div  class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[4]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit4">
                                                        </div>
                                                    </td>
                                                    <td v-show="enTB && is_admin">
                                                        <div  class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.La_flag_bits[5]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit5">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                        <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class=" text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange mr-sm"></i></span>
                                                        
                                                    </td>
                                                </tr>
                                            </template>
                                            
                                            
                                        </tbody>
                                    </table>
                                </div>
                                
                            </div>

                            <div v-show="mode==3" class="bg-panel mr-top-md" >
                                <div class="panel-header pd-md">
                                    <span class="panel-title ">
                                        <span class="layui-badge-dot layui-bg-olive"></span> 
                                        <span class="layui-text-xs ">保育方案参数</span>
    
                                        <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                        
                                    </span>
                                </div>

                                <div class="mr-md" style="overflow: auto;">
                                    <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                        <colgroup>
                                            <col width="40">
                                            <col width="40">
    
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
    
    
                                            <col width="60">
                                            <col width="60">
                                            <col width="60">
                                            <col width="60">
    
                                            <col width="60">
                                            
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th class="center" colspan="1" rowspan="3">日龄</th>
                                                <th class="center" colspan="1" rowspan="3">水料比</th>
    
                                                <th class="center" colspan="12" rowspan="1">时间段</th>
    
                                                <th class="center" colspan="1" rowspan="3">单次下料量(kg)</th>
                                                <!-- <th class="center" colspan="1" rowspan="3">自动出料时间保护(分)</th> -->
                                                <!-- <th class="center" colspan="1" rowspan="3">自动出水保护时间(分)</th> -->

                                                <th class="center" colspan="1" rowspan="3" >
                                                    自动出料时间保护 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3" >
                                                    自动出水保护时间 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>

                                                <th class="center" colspan="1" rowspan="3">单次补水量(L)</th>
    
                                                <th class="center" colspan="1" rowspan="3">重置</th>
                                            </tr>
    
                                            <tr>
                                                <th class="center" colspan="2" rowspan="1">第1餐</th>
                                                <th class="center" colspan="2" rowspan="1">第2餐</th>
                                                <th class="center" colspan="2" rowspan="1">第3餐</th>
                                                <th class="center" colspan="2" rowspan="1">第4餐</th>
                                                <th class="center" colspan="2" rowspan="1">第5餐</th>
                                                <th class="center" colspan="2" rowspan="1">第6餐</th>
                                            </tr>
                                            <tr>
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
                                            </tr>
                                            
                                        </thead>
                                        <tbody>
                                            <template  v-for="(item,idx) in Nr_para">
                                                <tr>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Nr_gday" @input="on_Nr_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" style="width: 40px">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Nr_waterFeed" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.Nr_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Nr_time[0]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits0">
                                                        </div>
                                                    </td>
    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Nr_time[1]" v-model="item.Nr_time[1]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits1">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Nr_time[2]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits2">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Nr_time[3]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits3">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Nr_time[4]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits4">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Nr_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Nr_time[5]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Nr_time" :class="item.Nr_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Nr_flag_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits5">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Nr_autoFeed" @input="validate_0_1_float(item,idx,event)"  name="Nr_autoFeed" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Nr_fgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Nr_wgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td style="width: 60px;">
                                                        <div class="layui-input-inline" >
                                                            <input type="text" v-model="item.Nr_cw" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    
    
                                                    <td >
                                                        <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                        <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange mr-sm"></i></span>
                                                        
                                                    </td>
                                                </tr>
                                            </template>
                                            
                                            
                                        </tbody>
                                    </table>
                                </div>

                                
                            </div>


                            <div v-show="mode==4 || (mode==3 && autoSwitchGrowthMode>0)" class="bg-panel mr-top-md" >
                                <div class="panel-header pd-md">
                                    <span class="panel-title ">
                                        <span class="layui-badge-dot layui-bg-olive"></span> 
                                        <span class="layui-text-xs ">育肥方案参数</span>
    
                                        <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                        
                                    </span>
                                </div>

                                <div class="mr-md" style="overflow: auto;">
                                    <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                        <colgroup>
                                            <col width="40">
                                            <col width="40">
    
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
    
    
                                            <col width="60">
                                            <col width="60">
                                            <col width="60">
                                            <col width="60">
    
                                            <col width="60">
                                            
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th class="center" colspan="1" rowspan="3">日龄</th>
                                                <th class="center" colspan="1" rowspan="3">水料比</th>
    
                                                <th class="center" colspan="12" rowspan="1">时间段</th>
    
                                                <th class="center" colspan="1" rowspan="3">单次下料量(kg)</th>
                                                <!-- <th class="center" colspan="1" rowspan="3">自动出料时间保护(分)</th> -->
                                                <!-- <th class="center" colspan="1" rowspan="3">自动出水保护时间(分)</th> -->
                                                <th class="center" colspan="1" rowspan="3" >
                                                    自动出料时间保护 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3" >
                                                    自动出水保护时间 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3">单次补水量(L)</th>
    
                                                <th class="center" colspan="1" rowspan="3">重置</th>
                                            </tr>
    
                                            <tr>
                                                <th class="center" colspan="2" rowspan="1">第1餐</th>
                                                <th class="center" colspan="2" rowspan="1">第2餐</th>
                                                <th class="center" colspan="2" rowspan="1">第3餐</th>
                                                <th class="center" colspan="2" rowspan="1">第4餐</th>
                                                <th class="center" colspan="2" rowspan="1">第5餐</th>
                                                <th class="center" colspan="2" rowspan="1">第6餐</th>
                                            </tr>
                                            <tr>
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
        
                                                <th class="center">时间</th>
                                                <th class="center">诱食</th>
                                            </tr>
                                            
                                        </thead>
                                        <tbody>
                                            <template  v-for="(item,idx) in Fat_para">
                                                <tr>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Fat_gday" @input="on_Fat_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" style="width: 40px">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Fat_waterFeed" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="item.Fat_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Fat_time[0]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits0">
                                                        </div>
                                                    </td>
    
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Fat_time[1]" v-model="item.Fat_time[1]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits1">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Fat_time[2]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits2">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Fat_time[3]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits3">
                                                        </div>
                                                    </td>
    
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Fat_time[4]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits4">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :id="'Fat_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Fat_time[5]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Fat_time" :class="item.Fat_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="item.Fat_flag_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits5">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Fat_autoFeed" @input="validate_0_1_float(item,idx,event)"  name="Fat_autoFeed"  lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Fat_fgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="item.Fat_wgapTime" @input="validate_int(0,255,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    <td style="width: 60px;">
                                                        <div class="layui-input-inline" >
                                                            <input type="text" v-model="item.Fat_cw" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
    
                                                    
    
                                                    <td >
                                                        <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                        <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange mr-sm"></i></span>
                                                        
                                                    </td>
                                                </tr>
                                            </template>
                                            
                                            
                                        </tbody>
                                    </table>
                                </div>
                                
                            </div>


                            <div v-show="mode==5" class="bg-panel mr-top-md">
                                <div class="panel-header pd-md">
                                    <span class="panel-title ">
                                        <span class="layui-badge-dot layui-bg-olive"></span> 
                                        <span class="layui-text-xs ">定时方案参数</span>
    
                                        <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10 mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                        
                                    </span>
                                </div>

                                <div class="mr-md" style="overflow: auto;">
                                    <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                        <colgroup>
                                            <col width="40">
                                            <col width="40">
                                            <col width="40">
    
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
                                            <col width="90">
                                            <col width="40">
    
                                            <col width="60">
                                            <col width="60" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                            <col width="60" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                            <col width="60">
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th class="center" colspan="1" rowspan="3">日总料量</th>
                                                <th class="center" colspan="1" rowspan="3">水料比</th>
                                                <th class="center" colspan="1" rowspan="3">餐数</th>
    
                                                <th class="center" colspan="12" rowspan="1">每餐下料(下料单位kg)</th>
    
                                                <th class="center" colspan="1" rowspan="3">补水</th>
                                                <!-- <th class="center" colspan="1" rowspan="3" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">自动出水保护时间(分)</th> -->
                                                <th class="center" colspan="1" rowspan="3" >
                                                    自动出水保护时间 单位:
                                                    <select lay-ignore style="height: 15px;
                                                        font-size: 11px;
                                                        background-color: #ffffff;
                                                        color: #000000;
                                                        border: 0px;
                                                        "  v-model="wp_unit"   >
                                                            <option  value="0">分</option>
                                                            <option  value="1">秒</option>
                                                    </select>
                                                </th>
                                                <th class="center" colspan="1" rowspan="3" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">单次补水量(L)</th>
                                                
                                                <th class="center" colspan="1" rowspan="3">重置</th>
                                                
                                                <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                            </tr>
    
                                            <tr>
                                                <th class="center" colspan="2" rowspan="1">第1餐</th>
                                                <th class="center" colspan="2" rowspan="1">第2餐</th>
                                                <th class="center" colspan="2" rowspan="1">第3餐</th>
                                                <th class="center" colspan="2" rowspan="1">第4餐</th>
                                                <th class="center" colspan="2" rowspan="1">第5餐</th>
                                                <th class="center" colspan="2" rowspan="1">第6餐</th>
                                            </tr>
    
                                            <tr>
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                <th class="center">时间</th>
                                                <th class="center">下料</th>
    
                                                
                                            <tr>
    
                                            
                                        </thead>
                                        <tbody>
                                            <template  v-if="Tmr_para.Tmr_time">
                                                <tr>
                                                
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_total_feed>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_waterFeed" @input="on_Tmr_waterFeed(item)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text"  :idx="0"  v-model="Tmr_para.Tmr_time[0]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[0]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
        
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :idx="1" v-model="Tmr_para.Tmr_time[1]" v-model="Tmr_para.Tmr_time[1]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[1]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :idx="2"  v-model="Tmr_para.Tmr_time[2]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[2]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :idx="3" v-model="Tmr_para.Tmr_time[3]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[3]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :idx="4" v-model="Tmr_para.Tmr_time[4]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                        </div>
                                                    </td>
                                                    <td >
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[4]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                        </div>
                                                    </td>
        
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" :idx="5" v-model="Tmr_para.Tmr_time[5]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_outT[5]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input" :class="Tmr_para.Tmr_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                        </div>
                                                    </td>
        
                                                    <td>
                                                        <div  class="layui-input-inline" style="width: 100%;">
                                                            <input type="checkbox" v-model="Tmr_para.Tmr_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Tmr_flag_bits0">
                                                        </div>
                                                    </td>
        
                                                    <td v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_wgapTime" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>
        
                                                    <td v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                                        <div class="layui-input-inline" style="width: 100%;">
                                                            <input type="text" v-model="Tmr_para.Tmr_cw" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                class="layui-input"  style="width: 60px;">
                                                        </div>
                                                    </td>

                                                    
        
                                                    <td >
                                                        <span style="display: block; width: 60px;" @click="onClearLine();" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange mr-sm"></i></span>
                                                        <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10 fr mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                        
                                                    </td>
                                                </tr>
                                            </template>
                                            
                                        </tbody>
                                    </table>
                                </div>
                                
                            </div>

                        </div>
                        
                    </div>

                    <div class="node_deliver_para" style="display: none;" v-clock>
                        <div class="bg-panel">
                            <div class="panel-header">

                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">基本参数</span>
                                </span>
                            </div>
                        </div>
                    </div>

                    <div class="node_bn_para" style="display: none;" v-clock>
                        <div class="bg-panel">
                            <div class="panel-header">

                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">基本参数</span>
                                </span>
                            </div>

                            <form  class="layui-form" lay-filter="form_node_bn_param">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">是否启用</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|关闭" name="_Enable">
                                        </div>
                                    </div>
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">SN序列号</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_bn_para.Sn" maxlength="8" placeholder="10位SN序列号" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">密码</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_bn_para.Passwd" maxlength="6" placeholder="密码" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        
                            <div class="layui-btn-group bn_group_btns" style="margin-top: 5px;">
                                <button class="layui-btn layui-btn-sm" style="background-color: #4958b9;" data-type="set" data-key="anim" data-value="group1">组1参数</button>
                                <button class="layui-btn layui-btn-sm " data-type="set" data-key="anim" data-value="group2">组2参数</button>
                            </div>
                            
                            <form  class="layui-form" id="form_node_bn_group_param" lay-filter="form_node_bn_group_param">
                                <div class="group1 div_his">
                                    <div class="bg-panel">
                                        <div class="panel-header">
    
                                            <span class="panel-title ">
                                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                                <span class="layui-text-xs ">组1参数</span>
                                            </span>
                                        </div>
                                        <div  class="layui-form" id="" lay-filter="">
                                            <div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">栏位编号</label>
                                                    <div class="layui-input-inline" >
                                                        <input type="text" v-model="node_bn_para.Hnum[0]" id="Hnum" maxlength="4" placeholder="AXXX" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                    <!-- <label class="layui-form-label-sm" onclick="autoCreateHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-help layui-text-orange"></i></label> -->
                                                    <!-- <label class="layui-form-label-sm" onclick="onSetHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-release layui-text-orange"></i></label> -->
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">日龄</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.Gday[0]" maxlength="3" @input="validate_int(0,999,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">模式</label>
                                                    <div class="layui-input-inline">
                                                        <select name="Mode0" lay-filter="Mode0" lay-verify="required" lay-search=""  >
                                                            <option value="0">停用</option>
                                                            <option value="1">补奶</option>
                                                        </select>
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">有余料AD值</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.CalAD[0]" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">无余料AD值</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.CalADR[0]" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
    
                                                <div class="layui-inline" >
                                                    <label class="layui-form-label-lg layui-form-label-sm">每次补奶时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="每次补奶时间" lay-offset="0"></i></label>
                                                    <div class="layui-input-inline">
                                                        <input type="text"  v-model="node_bn_para.TimeBN[0]" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                                <div class="layui-inline" >
                                                    <label class="layui-form-label-lg layui-form-label-sm">单次出奶量(ml) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="单次出奶量(ml)" lay-offset="0"></i></label>
                                                    <div class="layui-input-inline">
                                                        <input type="text"  v-model="node_bn_para.FeedML[0]" placeholder="0-1000" @input="validate_int(0,1000,event)" maxlength="4" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
    
                                        <div class="panel-header pd-md">
                                            <span class="panel-title ">
                                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                                <span class="layui-text-xs ">组1方案参数</span>
            
                                                <!-- <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button> -->
                                                <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                
                                            </span>
                                        </div>
                                        <div class="mr-md" style="overflow: auto;">
                                            <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                                <colgroup>
                                                    <col width="50">
            
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
            
                                                    <col width="130">
                                                    
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th class="center" colspan="1" rowspan="2">日龄</th>
                                                        <th class="center" colspan="6" rowspan="1">时间段</th>
                                                        <th class="center" colspan="1" rowspan="2">自动出料时间保护(秒)</th>
                                                    </tr>
                                                    <tr>
                                                        <th class="center" colspan="1" rowspan="1">第1餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第2餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第3餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第4餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第5餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第6餐</th>
                                                    </tr>
                                                    
                                                </thead>
                                                <tbody>
                                                    <template  v-for="(item,idx) in bn_para[0]">
                                                        <tr>
                                                            <td >
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" v-model="item.Bn_gday" @input="on_Bn_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input" style="width: 50px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-0'" :group="0" :idx="idx" :idx1="0" v-model="item.Bn_time[0]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-1'" :group="0" :idx="idx" :idx1="1" v-model="item.Bn_time[1]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-2'" :group="0" :idx="idx" :idx1="2" v-model="item.Bn_time[2]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-3'" :group="0" :idx="idx" :idx1="3" v-model="item.Bn_time[3]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-4'" :group="0" :idx="idx" :idx1="4" v-model="item.Bn_time[4]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-5'" :group="0" :idx="idx" :idx1="5" v-model="item.Bn_time[5]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" v-model="item.Bn_fgapTime" @input="validate_int(0,600,event)"  name=""  lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input"  style="width: 130px;">
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </template>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
    
                                    
                                    
                                </div>
                                <div class="group2 div_his layui-hide">
                                    <div class="bg-panel">
                                        <div class="panel-header">
    
                                            <span class="panel-title ">
                                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                                <span class="layui-text-xs ">组2参数</span>
                                            </span>
                                        </div>
                                        <div  class="layui-form" id="" lay-filter="">
                                            <div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">栏位编号</label>
                                                    <div class="layui-input-inline" >
                                                        <input type="text" v-model="node_bn_para.Hnum[1]" id="Hnum" maxlength="4" placeholder="AXXX" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                    <!-- <label class="layui-form-label-sm" onclick="autoCreateHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-help layui-text-orange"></i></label> -->
                                                    <!-- <label class="layui-form-label-sm" onclick="onSetHnum();" style="width: 20px;cursor: pointer;padding-left: 0px;"><i class="layui-icon layui-icon-release layui-text-orange"></i></label> -->
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">日龄</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.Gday[1]" maxlength="3" @input="validate_int(0,999,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">模式</label>
                                                    <div class="layui-input-inline">
                                                        <select name="Mode1" lay-filter="Mode1" lay-verify="required" lay-search=""  >
                                                            <option value="0">停用</option>
                                                            <option value="1">补奶</option>
                                                        </select>
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">有余料AD值</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.CalAD[1]" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                
                                                <div class="layui-inline">
                                                    <label class="layui-form-label-lg layui-form-label-sm">无余料AD值</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" v-model="node_bn_para.CalADR[1]" maxlength="4" @input="validate_int(1,4500,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
    
                                                <div class="layui-inline" >
                                                    <label class="layui-form-label-lg layui-form-label-sm">每次补奶时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="每次补奶时间" lay-offset="0"></i></label>
                                                    <div class="layui-input-inline">
                                                        <input type="text"  v-model="node_bn_para.TimeBN[1]" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                                <div class="layui-inline" >
                                                    <label class="layui-form-label-lg layui-form-label-sm">单次出奶量(ml) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="单次出奶量(ml)" lay-offset="0"></i></label>
                                                    <div class="layui-input-inline">
                                                        <input type="text"  v-model="node_bn_para.FeedML[1]" placeholder="0-1000" @input="validate_int(0,1000,event)" maxlength="4" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="panel-header pd-md">
                                            <span class="panel-title ">
                                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                                <span class="layui-text-xs ">组2方案参数</span>
            
                                                <!-- <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button> -->
                                                <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                
                                            </span>
                                        </div>
                                        <div class="mr-md" style="overflow: auto;">
                                            <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                                <colgroup>
                                                    <col width="50">
            
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
                                                    <col width="100">
            
                                                    <col width="130">
                                                    
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th class="center" colspan="1" rowspan="2">日龄</th>
                                                        <th class="center" colspan="6" rowspan="1">时间段</th>
                                                        <th class="center" colspan="1" rowspan="2">自动出料时间保护(秒)</th>
                                                    </tr>
                                                    <tr>
                                                        <th class="center" colspan="1" rowspan="1">第1餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第2餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第3餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第4餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第5餐</th>
                                                        <th class="center" colspan="1" rowspan="1">第6餐</th>
                                                    </tr>
                                                    
                                                </thead>
                                                <tbody>
                                                    <template  v-for="(item,idx) in bn_para[1]">
                                                        <tr>
                                                            <td >
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" v-model="item.Bn_gday" @input="on_Bn_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input" style="width: 50px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-0'" :group="1" :idx="idx" :idx1="0" v-model="item.Bn_time[0]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-1'" :group="1" :idx="idx" :idx1="1" v-model="item.Bn_time[1]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-2'" :group="1" :idx="idx" :idx1="2" v-model="item.Bn_time[2]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-3'" :group="1" :idx="idx" :idx1="3" v-model="item.Bn_time[3]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-4'" :group="1" :idx="idx" :idx1="4" v-model="item.Bn_time[4]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" :id="'Bn_time-'+idx+'-5'" :group="1" :idx="idx" :idx1="5" v-model="item.Bn_time[5]" @input="on_Bn_time(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input Bn_time" :class="item.Bn_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 100px">
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="layui-input-inline" style="width: 100%;">
                                                                    <input type="text" v-model="item.Bn_fgapTime" @input="validate_int(0,600,event)"  name=""  lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                                        class="layui-input"  style="width: 130px;">
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </template>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            
                        
                    </div>

                    <div class="node_jy_para" style="display: none;" v-clock>
                        <div class="bg-panel">
                            <div class="panel-header">

                                <span class="panel-title ">
                                    <span class="layui-badge-dot layui-bg-olive"></span> 
                                    <span class="layui-text-xs ">基本参数</span>
                                </span>
                            </div>

                            <form  class="layui-form" lay-filter="form_node_jy_param">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">是否启用</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|关闭" name="_Enable">
                                        </div>
                                    </div>
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">SN序列号</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.Sn" maxlength="8" placeholder="10位SN序列号" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" v-show="is_admin">
                                        <label class="layui-form-label-lg layui-form-label-sm">密码</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.Passwd" maxlength="6" placeholder="密码" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">模式</label>
                                        <div class="layui-input-inline">
                                            <select name="Mode" lay-filter="Mode" lay-verify="required" lay-search=""  >
                                                <option value="0">比例泵</option>
                                                <option value="1">自吸泵</option>
                                            </select>
                                        </div>
                                    </div>
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">1L水脉冲数</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.PulseWT" maxlength="4" placeholder="1L水脉冲数" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">1L药水脉冲数</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.PulseMED" maxlength="4" placeholder="1L药水脉冲数" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">无水脉冲超时时间(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToWT" maxlength="2" placeholder="无水脉冲超时时间 1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">无药水脉冲超时时间(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToMED" maxlength="2" placeholder="无药水脉冲超时时间 1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">药筒内药水(L)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.MlMED" oninput="validate_float(0,150,event)"  placeholder="0-150L" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    
                                    
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">加药加入水量(L)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.MlWaterAdd"  oninput="validate_float(0,150,event)" placeholder="0-150L" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">清洗过程水量(L)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.MlWaterClear" oninput="validate_float(0,150,event)"  placeholder="0-150L" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline" >
                                        <label class="layui-form-label-lg layui-form-label-sm">搅拌出药时长(分)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.MixTime" maxlength="3" placeholder="搅拌多少分钟后可以出药1 -999分钟" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">进水阀开到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToOpen[0]" maxlength="2" placeholder="阀体开到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">清水阀开到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToOpen[1]" maxlength="2" placeholder="阀体开到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">药水阀开到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToOpen[2]" maxlength="2" placeholder="阀体开到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">进水阀关到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToClose[0]" maxlength="2" placeholder="阀体关到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">清水阀关到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToClose[1]" maxlength="2" placeholder="阀体关到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label-lg layui-form-label-sm">药水阀关到位超时(秒)</label>
                                        <div class="layui-input-inline">
                                            <input type="text" v-model="node_jy_para.ToClose[2]" maxlength="2" placeholder="阀体关到位超时1-99秒" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>
                    
                </div>

                <div style="height: 50px;">
                    <button type="button" onclick="onApplyNode();" id="btnApplyNode" class="action-reset radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary">粘贴参数</button>
                    <button type="button" onclick="onCopyNode();" id="btnCopyNode" class="action-reset radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary">复制参数</button>
                    <button type="button" onclick="onReloadQrcode();" id="btnReloadQrcode" class="action-reset radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary">刷新二维码</button>
                    <button type="button" onclick="onClearRecord();" id="btnClearRecord" class="action-reset radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-delete layui-text-white mr-sm"></i> 清空记录</button>
                    <button type="button" onclick="onResetNode();" id="btnResetNode" class="action-reset radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-delete layui-text-white mr-sm"></i> 移除饲喂器</button>
                    <button type="button" onclick="onSaveAsPlan();" id="btnSaveAsPlan" class="action-edit radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-star layui-text-white mr-sm"></i> 另存为方案</button>
                    <button type="button" onclick="onSave();" class="action-edit radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 应用保存</button>
                    <button type="button" onclick="onRefresh();" class="action-edit radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-refresh layui-text-white mr-sm"></i> 刷新</button>
                    <button type="button" id="maxbtn" onclick="onMaxSize();" style="display: none;" class="radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-screen-full layui-text-white mr-sm"></i> 全屏</button>
                </div>
            </div>
        </div>
    </div>


</body>

<script src="../plugins/layui/layui.js"></script>
<script src="../plugins/vue/vue.min.js"></script>
<script src="../plugins/layui/xm-select-v1.2.4.js"></script>
<script src="../plugins/jquery/jquery-3.6.0.js?v=${.Config.basic.version}"></script>
<script src="../plugins/zTree/js/jquery.ztree.core.min.js?v=${.Config.basic.version}"></script>
<script src="../plugins/zTree/js/jquery.ztree.excheck.js?v=${.Config.basic.version}"></script>
<script src="../plugins/zTree/js/jquery.ztree.exedit.js?v=${.Config.basic.version}"></script>
<script src="../plugins/jquery.slimscroll.min.js"></script>
<script src="../plugins/toastr/toastr.min.js"></script>
<script src="../js/utils.js"></script>
<script src="../js/func.js?v=${.Config.basic.version}"></script>
<script src="../js/verify.js"></script>
<script>

    var no_display_zero = true;//是否把0显示为空
    var zTree=null;
    var table=null;
    var form=null;
    var Table=null;
    var lay_index=null;
    var curAddr=null;
    var laydate = null;

    var user_info=JSON.parse(window.localStorage.getItem("user_info"));
    var is_admin = user_info.is_admin;
    var is_admin = true;
    if(user_info.role_ids=="service"){
        is_admin = true;
    }
    console.info("is_admin:",is_admin)
    var func_url="${.func_url}";
    var actions=[];
    var token = window.localStorage.getItem("token");
    token = 'Bearer ' + token;

    var czqPara=null;//终端参数
    var czqState=null;
    var select_node_idx=null;
    var copy_node_para_str = null;//拷贝的饲喂器参数 json str

    var request = getRequest();
    console.info(request);

    var vm = new Vue({
        el: '.node_para',
        data: {
            is_admin:is_admin,
            mode:0,//模式
            model:0,//设备型号
            enTB:0,//是否启用触碰杆
            autoSwitchGrowthMode:0,
            wp_unit:-1,//保护时间单位
            node_para:{},
            Pg_para:[],
            La_para:[],
            Nr_para:[],
            Fat_para:[],
            Tmr_para:[],

            
        },
        updated:function(){
            console.info("updated")
            if(laydate){
                lay('.Pg_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(value, date, endDate);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);

                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Pg_para[idx].Pg_time[idx1] = value;

                            var Pg_feed_num = 0;
                            var Pg_total_feed = 0;
                            
                            for(var x=0;x<vm.Pg_para[idx].Pg_time.length;x++){
                                //console.info("vm.Pg_para[idx].Pg_time[x]=",vm.Pg_para[idx].Pg_time[x])
                                if(vm.Pg_para[idx].Pg_time[x]!=""){
                                    Pg_feed_num++;
                                    var out = 0;
                                    if((vm.Pg_para[idx].Pg_outT[x])!="" && !isNaN(vm.Pg_para[idx].Pg_outT[x])){
                                        out =parseFloat(vm.Pg_para[idx].Pg_outT[x]);
                                    }
                                    console.info("out=",out)
                                    Pg_total_feed+=out;
                                }
                            }

                            vm.Pg_para[idx].Pg_feed_num = Pg_feed_num;
                            vm.Pg_para[idx].Pg_total_feed = parseFloat(Pg_total_feed.toFixed(1));



                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });
                lay('.La_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.La_para[idx].La_time[idx1] = value;

                            var La_feed_num = 0;
                            var La_total_feed = 0;
                            
                            for(var x=0;x<vm.La_para[idx].La_time.length;x++){
                                if(vm.La_para[idx].La_time[x]!=""){
                                    La_feed_num++;
                                    var out = 0;
                                    if((vm.La_para[idx].La_outT[x])!="" && !isNaN(vm.La_para[idx].La_outT[x])){
                                        out =parseFloat(vm.La_para[idx].La_outT[x]);
                                    }
                                    La_total_feed+=out;
                                }
                            }

                            vm.La_para[idx].La_feed_num = La_feed_num;
                            vm.La_para[idx].La_total_feed = parseFloat(La_total_feed.toFixed(1));

                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                lay('.Nr_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Nr_para[idx].Nr_time[idx1] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });


                lay('.Fat_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Fat_para[idx].Fat_time[idx1] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                lay('.Tmr_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            console.info(idx,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Tmr_para.Tmr_time[idx] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                form.render(); //更新全部

                
            }
        },
        watch: {
            // 当message变化时，这个函数就会被调用
            wp_unit: function (newValue, oldValue) {
                if(newValue!=oldValue && oldValue!=-1){
                    console.info("wp_unit change:",oldValue,newValue);
                    console.info("vm.wp_unit="+vm.wp_unit);
                    if(vm.wp_unit==0){
                        //切换为分钟
                        changePUnitMinute();
                    }
                    else{
                        //切换为秒
                        changePUnitSeconds();
                    }
                }
                
            }
        }
    });

    var vm_deliver = new Vue({
        el: '.node_deliver_para',
    });
    
    var vm_bn = new Vue({
        el: '.node_bn_para',
        data: {
            is_admin:is_admin,
            mode_bn:0,//模式
            node_bn_para:{
                Hnum:["",""],
                Gday:["",""],
                CalAD:["",""],
                CalADR:["",""],
                TimeBN:["",""],
                FeedML:["",""],
            },
            bn_para:[],
        },
        updated:function(){
            if(laydate){
                lay('.Bn_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var group = parseInt($(this.elem[0]).attr("group"));
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm_bn.bn_para[group][idx].Bn_time[idx1] = value;
                            vm_bn.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });
            }
        },
        
    });

    var vm_jy = new Vue({
        el: '.node_jy_para',
        data: {
            is_admin:is_admin,
            node_jy_para:{
                ToOpen:["","",""],
                ToClose:["","",""],
            }
        }
    });

    var selectedTreeNode=null;
    var tree_setting = {
        view: {
            dblClickExpand: false,
            fontCss: getFont,
            nameIsHTML: true,
        },
        callback: {
            onClick: treeOnClick,
        }
    };
    function getFont(treeId, node) {
        return node.font ? node.font : {};
    }
    function treeOnClick(event, treeId, treeNode) {
        selectedTreeNode=treeNode;
        console.info(selectedTreeNode);

        if(selectedTreeNode.type=="DMXFGW"){
            $(".para").show();
            $(".node_para").hide();
            $(".node_deliver_para").hide();
            $(".node_bn_para").hide();
            $(".node_jy_para").hide();
            if(is_admin){
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").hide();
                $("#btnClearRecord").show();
                $("#btnReloadQrcode").hide();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }else{
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").show();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").hide();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }
            
        }else if(selectedTreeNode.type=="deliver"){
            $(".para").hide();
            $(".node_para").hide();
            $(".node_deliver_para").show();
            $(".node_bn_para").hide();
            $(".node_jy_para").hide();
        }else if(selectedTreeNode.type=="bn"){
            $(".para").hide();
            $(".node_para").hide();
            $(".node_deliver_para").hide();
            $(".node_bn_para").show();
            $(".node_jy_para").hide();

            if(is_admin){
                $("#btnResetNode").show();
                $("#btnSaveAsPlan").show();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").show();
                $("#btnApplyNode").show();
            }else{
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").hide();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }

            var nodeBnPara = czqPara.NodeBNParas[selectedTreeNode.idx];
            var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];
            select_node_idx = selectedTreeNode.idx;
            disPlayBnNode(nodeBnPara,nodeEn);
        }
        else if(selectedTreeNode.type=="jy"){
            $(".para").hide();
            $(".node_para").hide();
            $(".node_deliver_para").hide();
            $(".node_bn_para").hide();
            $(".node_jy_para").show();

            if(is_admin){
                $("#btnResetNode").show();
                $("#btnSaveAsPlan").show();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").show();
                $("#btnApplyNode").show();
            }else{
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").hide();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }

            var nodeJyPara = czqPara.NodeJyParas[selectedTreeNode.idx];
            var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];
            select_node_idx = selectedTreeNode.idx;
            disPlayJyNode(nodeJyPara,nodeEn);
        }
        else if(selectedTreeNode.type=="fg"){
            $(".para").hide();
            $(".node_para").show();
            $(".node_deliver_para").hide();
            $(".node_bn_para").hide();
            $(".node_jy_para").hide();
            if(is_admin){
                $("#btnResetNode").show();
                $("#btnSaveAsPlan").show();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").show();
                $("#btnApplyNode").show();
            }else{
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").hide();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }

            var nodePara = czqPara.NodeFgParas[selectedTreeNode.idx];
            //cur_node_para = nodePara;
            var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];
            select_node_idx = selectedTreeNode.idx;

            //粥料器与饲喂器一样
            disPlayNode(nodePara,nodeEn);
        }
        else if(selectedTreeNode.type=="feed"){
            $(".para").hide();
            $(".node_para").show();
            $(".node_deliver_para").hide();
            $(".node_bn_para").hide();
            $(".node_jy_para").hide();
            if(is_admin){
                $("#btnResetNode").show();
                $("#btnSaveAsPlan").show();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").show();
                $("#btnApplyNode").show();
            }else{
                $("#btnResetNode").hide();
                $("#btnSaveAsPlan").hide();
                $("#btnClearRecord").hide();
                $("#btnReloadQrcode").show();
                $("#btnCopyNode").hide();
                $("#btnApplyNode").hide();
            }

            var nodePara = czqPara.NodeParas[selectedTreeNode.idx];
            //cur_node_para = nodePara;
            var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];
            select_node_idx = selectedTreeNode.idx;

            disPlayNode(nodePara,nodeEn);
        }
    }

    layui.config({
        base: '../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','layer','form', 'table','transfer','laydate','util'],function(){
        form = layui.form;
        table = layui.table;
        transfer = layui.transfer;
        laydate = layui.laydate;
        var util = layui.util;

        toastr.options = {
            "closeButton": false, //是否显示关闭按钮
            "debug": false, //是否使用debug模式
            "positionClass": "toast-top-center",//弹出窗的位置
            "showDuration": "300",//显示的动画时间
            "hideDuration": "1000",//消失的动画时间
            "timeOut": "2000", //展现时间
            "extendedTimeOut": "1000",//加长展示时间
            "showEasing": "swing",//显示时的动画缓冲方式
            "hideEasing": "linear",//消失时的动画缓冲方式
            "showMethod": "fadeIn",//显示时的动画方式
            "hideMethod": "fadeOut" //消失时的动画方式
        };

        $("#btnResetNode").hide();
        $("#btnSaveAsPlan").hide();
        $("#btnReloadQrcode").hide();
        $(".para").show();
        $(".node_para").hide();
        $("#btnCopyNode").hide();
        $("#btnApplyNode").hide();

        $.ajax({
            type: 'GET',
            url: '../Api/User/Actions',
            data: {func_url:func_url},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (data) {
                console.info(data)
                actions=data.data;
                checkPermission();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('加载操作信息失败');
            }
        });

        form.on('submit(btn_auto_name)',function(data){
            var obj = form.val('form_param');
            obj.SiteName = request.farmname;
            obj.HouseName = request.remark;
            form.val('form_param',obj);
        });

        form.on('submit(btn_save_param)', function(data){
            var addr = czqPara.Addr;
            console.info(addr);
            //ApplyPara(data.field);

            

            czqPara.Addr = data.field.Addr;
            czqPara.Sip = data.field.Sip;
            czqPara.Port = data.field.Port;
            czqPara.ComType = data.field.ComType;
            czqPara.Dhcp = data.field.Dhcp=="on"?"1":"0";
            czqPara.Lip = data.field.Lip;
            czqPara.Gw = data.field.Gw;
            czqPara.Msk = data.field.Msk;
            czqPara.Apn = data.field.Apn;
            czqPara.User = data.field.User;
            czqPara.Pass = data.field.Pass;
            console.info(czqPara);

            layer.load(1);
            $.ajax({
                type: 'PUT',
                url: '../Api/Device/Gw/Param',
                data: {addr:addr,params:JSON.stringify(czqPara)},
                beforeSend: function(request) {
                    request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
                },
                success: function(res){
                    if(res){
                        if(res.code>=0){
                            //保存成功
                            layer.close(lay_index);
                            toastr.success(res.msg);

                            czqPara.EnMaxNode = data.field.EnMaxNode=="on"?"1":"0";
                            czqPara.MaxNode = data.field.MaxNode;
                            czqPara.SiteName = data.field.SiteName;
                            czqPara.HouseName = data.field.HouseName;
                            console.info(czqPara);
                            saveExtPara(addr,JSON.stringify(czqPara)).then(function(res) {
                                if(res.code>=0){
                                    
                                }
                            });
                        }else{
                            //layer.alert(res.msg);
                            toastr.warning(res.msg, "异常");
                        }
                    }
                },
                complete: function(XMLHttpRequest, textStatus) {
                    layer.closeAll('loading');
                },
                dataType: "json"
            });
        });

        form.on('submit(btn_save_plan)', function(data){
            doSavePlan(data.field);
        });
        form.on('select(Mode)', function(data){
            var Mode=data.value;
            console.info("Mode",Mode);
            vm.mode = Mode;
            vm.node_para.Mode = Mode;
            //loadHouse(cur_farm_id,id);
            resize();
        });

        form.on('switch(_EnTB)', function(data){
            console.log(data.elem.checked); //开关是否开启，true或者false
            vm.enTB = data.elem.checked?1:0;
        });  

        form.on('switch(_EnAutoSwitchGrowthMode)', function(data){
            console.log(data.elem.checked); //开关是否开启，true或者false
            vm.autoSwitchGrowthMode = data.elem.checked?1:0;
        }); 

        loadPara(request);
        if(request.max && request.max>0){
            $("#maxbtn").hide();
        }else{
            $("#maxbtn").show();
        }
    });

    function checkPermission(){
        for(var i=0;i<actions.length;i++){
            $('.action-'+actions[i].action_id).removeClass("layui-hide");
        }
    }


    function loadPara(item) {
        zTree = $.fn.zTree.init($("#tree"), tree_setting, []);
        //$("#form_param")[0].reset();
        layer.load(1);
        $.ajax({
            type: 'get',
            url: '../Api/Device/Gw/Param',
            data: {addr:item.device_addr},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                if(res.code>=0){
                    czqPara = res.data;
                    console.info(czqPara);


                    var rootNode={name:item.device_addr+" "+item.housename,type:item.device_type,children:[]};

                    for(var i=0;i<czqPara.NodeEn.length;i++){
                        if(czqPara.NodeMode[i]=="241"){
                            //拉料设备不显示
                            rootNode.children.push({
                                idx:i,
                                type:'deliver',
                                //name:czqPara.NodeParas[i].Sn,
                                name:(i+1).toString()+":[拉料器] "+ czqPara.NodeParas[i].Sn,
                                enable:czqPara.NodeEn[i],
                                online:-1,
                            });
                        }
                        else if(czqPara.NodeMode[i]=="243"){
                            //补奶器
                            rootNode.children.push({
                                idx:i,
                                type:'bn',
                                name:(i+1).toString()+":[补奶器] "+ czqPara.NodeBNParas[i].Sn,
                                enable:czqPara.NodeEn[i],
                                online:-1,
                            });
                        }
                        else if(czqPara.NodeMode[i]=="245"){
                            //加药器
                            rootNode.children.push({
                                idx:i,
                                type:'jy',
                                name:(i+1).toString()+":[加药器] "+ czqPara.NodeJyParas[i].Sn,
                                enable:czqPara.NodeEn[i],
                                online:-1,
                            });
                        }
                        else if(czqPara.NodeMode[i]=="168"){
                            //粥料器
                            rootNode.children.push({
                                idx:i,
                                type:'fg',
                                name:(i+1).toString()+":[粥料器]"+"["+(czqPara.NodeFgParas[i].Hnum).toString()+"] "+ czqPara.NodeFgParas[i].Sn,
                                enable:czqPara.NodeEn[i],
                                online:-1,
                            });
                        }
                        else{
                            rootNode.children.push({
                                idx:i,
                                type:'feed',
                                //name:czqPara.NodeParas[i].Sn,
                                name:(i+1).toString()+":["+(czqPara.NodeParas[i].Hnum).toString()+"] "+ czqPara.NodeParas[i].Sn,
                                enable:czqPara.NodeEn[i],
                                online:-1,
                            });
                        }
                        
                    }

                    var nodes=[];
                    nodes.push(rootNode);

                    nodes=setDataIcon(nodes);
                    zTree = $.fn.zTree.init($("#tree"), tree_setting, nodes);

                    if(czqPara.Dhcp==0){
                        czqPara.Dhcp = '';
                    }else{
                        czqPara.Dhcp = 'on';
                    }
                    form.val("form_param",czqPara);

                    getExtPara(item.device_addr).then(function(res) {
                        if(res.code>=0){
                            console.info(res.data);
                            var expara = res.data;
                            if(expara.EnMaxNode>0){
                                czqPara.EnMaxNode = "on";
                            }else{
                                czqPara.EnMaxNode = "";
                            }
                            czqPara.MaxNode = expara.MaxNode;
                            czqPara.HouseName = expara.HouseName;
                            czqPara.SiteName = expara.SiteName;

                            form.val("form_param",czqPara);
                        }
                    });
                    resize();


                    if(select_node_idx!=null){
                        var nodes = zTree.getNodesByParam("idx", select_node_idx, null);
                        if(nodes.length>0){
                            const node = nodes[0];
                            //console.info(node);
                            zTree.selectNode(node);
                            zTree.setting.callback.onClick(null,null,node);//手动触发onClick事件
                        }
                    }

                }else{

                    layer.alert(res.msg);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('读取设备参数失败');
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },

        });
    }

    function getExtPara(addr){
        var promise = new Promise(function(resolve, reject) {
            $.ajax({
                type: 'GET',
                url: '../Api/Device/Gw/ExParam',
                data: {addr:addr},
                beforeSend: function(request) {
                    request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
                },
                success: function (data) {

                    if (data && data.code>=0) {
                        resolve(data);
                    }else{
                        resolve(data);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    reject(err);
                },
                complete: function(XMLHttpRequest, textStatus) {

                },
                dataType: "json"
            });
        });
        return promise;
    }
    
    function saveExtPara(addr,params){
        var promise = new Promise(function(resolve, reject) {
            $.ajax({
                type: 'PUT',
                url: '../Api/Device/Gw/ExParam',
                data: {addr:addr,params:params},
                beforeSend: function(request) {
                    request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
                },
                success: function (data) {

                    if (data && data.code>=0) {
                        resolve(data);
                    }else{
                        resolve(data);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    reject(err);
                },
                complete: function(XMLHttpRequest, textStatus) {

                },
                dataType: "json"
            });
        });
        return promise;
    }

    function validate_0_0dot5_float(obj,idx,event){
        console.info("validate_0_0dot5_float",JSON.stringify(obj));
        console.info("validate_0_0dot5_float",idx);
        console.info("validate_0_0dot5_float",event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < 0 || parseFloat(val) > 0.5) {
            toastr.error("必须在0-0.5范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
            setTimeout(()=>{$(event.target).val(val);},50)
        }else{
            
        }
        
        setTimeout(()=>{obj[name] = val;},50)
    }

    function validate_0_1_float(obj,idx,event){
        console.info("validate_0_1_float",JSON.stringify(obj));
        console.info("validate_0_1_float",idx);
        console.info("validate_0_1_float",event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < 0 || parseFloat(val) > 1) {
            toastr.error("必须在0-1范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
            setTimeout(()=>{$(event.target).val(val);},50)
        }else{
            
        }
        
        setTimeout(()=>{obj[name] = val;},50)
    }

    function validate_int(min,max,event){
        console.info(event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < min || parseFloat(val) > max) {
            toastr.error("必须在"+min+"-"+max+"范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
            
            setTimeout(()=>{$(event.target).val(val);},50)
        }else{
            $(event.target).css("background","#ffffff");
        }
    }

    function validate_float(min,max,event){
        console.info(event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < min || parseFloat(val) > max) {
            toastr.error("必须在"+min+"-"+max+"范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
            
            setTimeout(()=>{$(event.target).val(val);},50)
        }else{
            $(event.target).css("background","#ffffff");
        }
    }

    function onPg_outT(idx,idx1,event){
        var Pg_feed_num = 0;
        var Pg_total_feed = 0;
        for(var x=0;x<vm.Pg_para[idx].Pg_time.length;x++){
            if(vm.Pg_para[idx].Pg_time[x]!=""){
                Pg_feed_num++;
                if(vm.Pg_para[idx].Pg_outT[x]==""){
                    vm.Pg_para[idx].Pg_outT[x] = 0;
                }
                Pg_total_feed+=parseFloat(vm.Pg_para[idx].Pg_outT[x]);
            }
        }
        vm.Pg_para[idx].Pg_feed_num = Pg_feed_num;
        vm.Pg_para[idx].Pg_total_feed = parseFloat(Pg_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function onLa_outT(idx,idx1,event){
        var La_feed_num = 0;
        var La_total_feed = 0;
        for(var x=0;x<vm.La_para[idx].La_time.length;x++){
            if(vm.La_para[idx].La_time[x]!=""){
                La_feed_num++;
                if(vm.La_para[idx].La_outT[x]==""){
                    vm.La_para[idx].La_outT[x] = 0;
                }
                La_total_feed+=parseFloat(vm.La_para[idx].La_outT[x]);
            }
        }
        vm.La_para[idx].La_feed_num = La_feed_num;
        vm.La_para[idx].La_total_feed = parseFloat(La_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function onTmr_outT(idx,event){
        console.info(idx,JSON.stringify(event));
        console.info(JSON.stringify(vm.Tmr_para));
        var Tmr_feed_num = 0;
        var Tmr_total_feed = 0;
        for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++){
            if(vm.Tmr_para.Tmr_time[x]!=""){
                Tmr_feed_num++;
                if(vm.Tmr_para.Tmr_outT[x]==""){
                    vm.Tmr_para.Tmr_outT[x] = 0;
                }
                Tmr_total_feed+=parseFloat(vm.Tmr_para.Tmr_outT[x]);
            }
        }
        vm.Tmr_para.Tmr_feed_num = Tmr_feed_num;
        vm.Tmr_para.Tmr_total_feed = parseFloat(Tmr_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function disPlayNode(para,nodeEn) {
        var nodePara = JSON.parse(JSON.stringify(para));
        console.info("nodePara",JSON.stringify(nodePara));
        //兼容粥料器
        if(nodePara.Model && nodePara.Model == "168"){
            vm.model = "168";
            //粥料器
            if(nodePara.Mode=="0"){
                nodePara.Mode = "0"; //停用
            }else if(nodePara.Mode=="1"){
                nodePara.Mode = "3"; //保育
            }else if(nodePara.Mode=="2"){
                nodePara.Mode = "4"; //育肥
            }else if(nodePara.Mode=="3"){
                nodePara.Mode = "5"; //定时
            }


            //重新修改模式下拉框
            $("#Mode").empty();
            $("#Mode").append("<option value='0'>停用</option>");
            $("#Mode").append("<option value='3'>保育</option>");
            $("#Mode").append("<option value='4'>育肥</option>");
            $("#Mode").append("<option value='5'>定时</option>");
        }else{
            vm.model = "0";
            //重新修改模式下拉框
            $("#Mode").empty();
            $("#Mode").append("<option value='0'>停用</option>");
            $("#Mode").append("<option value='1'>妊娠</option>");
            $("#Mode").append("<option value='2'>哺乳</option>");
            $("#Mode").append("<option value='3'>保育</option>");
            $("#Mode").append("<option value='4'>育肥</option>");
            $("#Mode").append("<option value='5'>定时</option>");
        }
        form.render('select');
        var form_node_param = {};
        form_node_param["_EnWater"] = nodePara.EnWater>0?"on":"";
        form_node_param["_EnTB"] = nodePara.EnTB>0?"on":"";
        form_node_param["_Enable"] = nodeEn>0?"on":"";
        form_node_param["Mode"] = nodePara.Mode;
        if(nodePara.Tmr_flag_bits[1]){
            form_node_param["_EnAutoSwitchGrowthMode"] = "on";
            vm.autoSwitchGrowthMode = 1;
        }else{
            form_node_param["_EnAutoSwitchGrowthMode"] = "";
            vm.autoSwitchGrowthMode = 0;
        }
        if(nodePara.Tmr_flag_bits[2]){
            form_node_param["_EnFirstTouchAsFirstFeed"] = "on";
        }else{
            form_node_param["_EnFirstTouchAsFirstFeed"] = "";
        }
        if(nodePara.Tmr_flag_bits[3]){
            form_node_param["_EnMotorCurProtect"] = "";
        }else{
            form_node_param["_EnMotorCurProtect"] = "on";
        }
        if(nodePara.Tmr_flag_bits[4]){
            form_node_param["_EnMotorCurIdle"] = "on";
        }else{
            form_node_param["_EnMotorCurIdle"] = "";
        }

        if(nodePara.Tmr_flag_bits[5]){
            vm.wp_unit = "1";
        }else{
            vm.wp_unit = "0";
        }
        console.info("form_node_param",form_node_param);
        form.val("form_node_param",form_node_param);

        console.info("nodePara.Pg_gday",nodePara.Pg_gday);
        //模式
        vm.mode = nodePara.Mode;
        vm.enTB = nodePara.EnTB;
        
        //妊娠
        vm.Pg_para = [];
        for(var i=0;i<nodePara.Pg_gday.length;i++)
        {
            //计算当日总料量
            var Pg_feed_num = 0;
            var Pg_total_feed = 0;
            var Pg_time = [];
            
            for(var x=0;x<nodePara.Pg_startT[i].length;x++){
                

                if(nodePara.Pg_startT[i][x]!="00:00" || nodePara.Pg_endT[i][x]!="00:00"){
                    Pg_time.push(nodePara.Pg_startT[i][x]+" - "+nodePara.Pg_endT[i][x]);
                    if(nodePara.Pg_outT[i][x]=="" || isNaN(nodePara.Pg_outT[i][x])){
                        Pg_total_feed += 0;
                    }else{
                        Pg_total_feed += parseFloat(nodePara.Pg_outT[i][x]);

                    }
                    //Pg_total_feed += parseFloat(nodePara.Pg_outT[i][x]);
                    Pg_feed_num+=1;
                }else{
                    if(no_display_zero){
                        Pg_time.push("");
                    }
                    else{
                        Pg_time.push(nodePara.Pg_startT[i][x]+" - "+nodePara.Pg_endT[i][x]);
                    }
                }

                nodePara.Pg_outT[i][x] = (parseFloat(nodePara.Pg_outT[i][x])>0?nodePara.Pg_outT[i][x]:"");
            }

            console.info("nodePara.Pg_outT[i]",nodePara.Pg_outT[i])
            //console.info(nodePara.Pg_flag_bits[i])
            vm.Pg_para.push({
                Pg_gday:nodePara.Pg_gday[i],
                //Pg_startT:nodePara.Pg_startT[i],
                //Pg_endT:nodePara.Pg_endT[i],
                Pg_outT:nodePara.Pg_outT[i],
                Pg_waterFeed:nodePara.Pg_waterFeed[i],
                Pg_firstFeed:nodePara.Pg_firstFeed[i],
                Pg_ftbFeed:nodePara.Pg_ftbFeed[i],
                Pg_tbFeed:nodePara.Pg_tbFeed[i],
                Pg_wgapTime:nodePara.Pg_wgapTime[i],
                Pg_cw:nodePara.Pg_cw[i],
                Pg_autoFeed:nodePara.Pg_autoFeed[i],
                Pg_fgapTime:nodePara.Pg_fgapTime[i],
                Pg_flag:nodePara.Pg_flag[i],
                Pg_flag_bits:nodePara.Pg_flag_bits[i],
                Pg_rev:nodePara.Pg_rev[i],
                Pg_rev_bits:nodePara.Pg_rev_bits[i],

                Pg_feed_num:Pg_feed_num,
                Pg_time:Pg_time,
                Pg_total_feed:parseFloat(Pg_total_feed.toFixed(2)),
            });
        }
        console.info(JSON.stringify(vm.Pg_para));

        //哺乳
        vm.La_para = [];
        for(var i=0;i<nodePara.La_gday.length;i++)
        {
            //计算当日总料量
            var La_feed_num = 0;
            var La_total_feed = 0;
            var La_time = [];
            
            for(var x=0;x<nodePara.La_startT[i].length;x++){
                

                if(nodePara.La_startT[i][x]!="00:00" || nodePara.La_endT[i][x]!="00:00"){
                    La_time.push(nodePara.La_startT[i][x]+" - "+nodePara.La_endT[i][x]);
                    if(nodePara.La_outT[i][x]=="" || isNaN(nodePara.La_outT[i][x])){
                        La_total_feed += 0;
                    }else{
                        La_total_feed += parseFloat(nodePara.La_outT[i][x]);
                    }
                    //La_total_feed += parseFloat(nodePara.La_outT[i][x]);
                    La_feed_num+=1;
                }else{
                    if(no_display_zero){
                        La_time.push("");
                    }
                    else{
                        La_time.push(nodePara.La_startT[i][x]+" - "+nodePara.La_endT[i][x]);
                    }
                }

                nodePara.La_outT[i][x] = (parseFloat(nodePara.La_outT[i][x])>0?nodePara.La_outT[i][x]:"");
            }
            
            vm.La_para.push({
                La_gday:nodePara.La_gday[i],
                La_startT:nodePara.La_startT[i],
                La_endT:nodePara.La_endT[i],
                La_outT:nodePara.La_outT[i],
                La_waterFeed:nodePara.La_waterFeed[i],
                La_firstFeed:nodePara.La_firstFeed[i],
                La_ftbFeed:nodePara.La_ftbFeed[i],
                La_tbFeed:nodePara.La_tbFeed[i],
                La_wgapTime:nodePara.La_wgapTime[i],
                La_cw:nodePara.La_cw[i],
                La_autoFeed:nodePara.La_autoFeed[i],
                La_fgapTime:nodePara.La_fgapTime[i],
                La_flag:nodePara.La_flag[i],
                La_flag_bits:nodePara.La_flag_bits[i],
                La_rev:nodePara.La_rev[i],
                La_rev_bits:nodePara.La_rev_bits[i],

                La_feed_num:La_feed_num,
                La_time:La_time,
                La_total_feed:parseFloat(La_total_feed.toFixed(2)),
            });
        }

        //保育
        vm.Nr_para = [];
        for(var i=0;i<nodePara.Nr_gday.length;i++)
        {
            //计算当日总料量
            var Nr_time = [];
            
            for(var x=0;x<nodePara.Nr_startT[i].length;x++){
                //Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);

                if(nodePara.Nr_startT[i][x]!="00:00" || nodePara.Nr_endT[i][x]!="00:00"){
                    Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);
                }else{
                    if(no_display_zero){
                        Nr_time.push("");
                    }
                    else{
                        Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);
                    }
                }
            }
            vm.Nr_para.push({
                Nr_gday:nodePara.Nr_gday[i],
                Nr_startT:nodePara.Nr_startT[i],
                Nr_endT:nodePara.Nr_endT[i],
                
                Nr_waterFeed:nodePara.Nr_waterFeed[i],
                Nr_autoFeed:nodePara.Nr_autoFeed[i],
                Nr_fgapTime:nodePara.Nr_fgapTime[i],
                Nr_wgapTime:nodePara.Nr_wgapTime[i],
                Nr_cw:nodePara.Nr_cw[i],
                Nr_flag:nodePara.Nr_flag[i],
                Nr_flag_bits:nodePara.Nr_flag_bits[i],

                Nr_time:Nr_time,
            });
        }

        //育肥
        vm.Fat_para = [];
        for(var i=0;i<nodePara.Fat_gday.length;i++)
        {
            //计算当日总料量
            var Fat_time = [];
            
            for(var x=0;x<nodePara.Fat_startT[i].length;x++){
                //Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                if(nodePara.Fat_startT[i][x]!="00:00" || nodePara.Fat_endT[i][x]!="00:00"){
                    Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                }else{
                    if(no_display_zero){
                        Fat_time.push("");
                    }
                    else{
                        Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                    }
                }
            }
            vm.Fat_para.push({
                Fat_gday:nodePara.Fat_gday[i],
                Fat_startT:nodePara.Fat_startT[i],
                Fat_endT:nodePara.Fat_endT[i],
                
                Fat_waterFeed:nodePara.Fat_waterFeed[i],
                Fat_autoFeed:nodePara.Fat_autoFeed[i],
                Fat_fgapTime:nodePara.Fat_fgapTime[i],
                Fat_wgapTime:nodePara.Fat_wgapTime[i],
                Fat_cw:nodePara.Fat_cw[i],
                Fat_flag:nodePara.Fat_flag[i],
                Fat_flag_bits:nodePara.Fat_flag_bits[i],

                Fat_time:Fat_time,
            });
        }

        //定时
        vm.Tmr_para = {};
        var Tmr_time = [];
        var Tmr_feed_num = 0;
        var Tmr_total_feed = 0;

        for(var i=0;i<nodePara.Tmr_startT.length;i++)
        {
            
            /*if(nodePara.Tmr_startT[i]!="00:00" || nodePara.Tmr_endT[i]!="00:00"){
                Tmr_total_feed += parseFloat(nodePara.Tmr_outT[i]);
                Tmr_feed_num+=1;
            }
            Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);*/

            if(nodePara.Tmr_startT[i]!="00:00" || nodePara.Tmr_endT[i]!="00:00"){
                Tmr_total_feed += parseFloat(nodePara.Tmr_outT[i]);
                Tmr_feed_num+=1;
                Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);
            }else{
                if(no_display_zero){
                    Tmr_time.push("");
                }
                else{
                    Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);
                }
            }
            nodePara.Tmr_outT[i] = (parseFloat(nodePara.Tmr_outT[i])>0?nodePara.Tmr_outT[i]:"");
        }
        vm.Tmr_para = {
            Tmr_outT:nodePara.Tmr_outT,
            Tmr_waterFeed:nodePara.Tmr_waterFeed,
            Tmr_wgapTime:nodePara.Tmr_wgapTime,
            Tmr_cw:nodePara.Tmr_cw,
            Tmr_flag:nodePara.Tmr_flag,

            Tmr_time:Tmr_time,
            Tmr_feed_num:Tmr_feed_num,
            Tmr_total_feed:Tmr_total_feed,
            Tmr_flag_bits:nodePara.Tmr_flag_bits,
        };

        vm.node_para = nodePara;

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    
    function disPlayBnNode(nodeBnPara,nodeEn){
        
        vm_bn.node_bn_para = nodeBnPara;

        var form_node_bn_param = {};
        form_node_bn_param["_Enable"] = nodeEn>0?"on":"";
        form.val("form_node_bn_param",form_node_bn_param);

        var form_node_bn_group_param ={};
        form_node_bn_group_param["Mode0"] = nodeBnPara.Mode[0];
        form_node_bn_group_param["Mode1"] = nodeBnPara.Mode[1];
        form.val("form_node_bn_group_param",form_node_bn_group_param);

        vm_bn.bn_para = [];
        for(var x=0;x<2;x++)
        {
            var group_para= [];
            for(var i=0;i<nodeBnPara.Bn_gday[x].length;i++)
            {
                var bn_time = [];
                for(var j=0;j<nodeBnPara.Bn_startT[x][i].length;j++){
                    if(nodeBnPara.Bn_startT[x][i][j]!="00:00" || nodeBnPara.Bn_endT[x][i][j]!="00:00"){
                        bn_time.push(nodeBnPara.Bn_startT[x][i][j]+" - "+nodeBnPara.Bn_endT[x][i][j]);
                    }else{
                        if(no_display_zero){
                            bn_time.push("");
                        }
                        else{
                            bn_time.push(nodeBnPara.Bn_startT[x][i][j]+" - "+nodeBnPara.Bn_endT[x][i][j]);
                        }
                    }
                }

                group_para.push({
                    Bn_gday:nodeBnPara.Bn_gday[x][i],
                    Bn_fgapTime:nodeBnPara.Bn_fgapTime[x][i],
                    Bn_flag:nodeBnPara.Bn_flag[x][i],
                    Bn_time:bn_time,
                });
            }

            vm_bn.bn_para.push(group_para);
        }
        
        console.info("bn_para",JSON.stringify(vm_bn.bn_para));
        
        vm_bn.$forceUpdate();

        var active = {
            set: function(othis){
                var THIS = 'layui-bg-normal'
                    ,key = othis.data('key')
                    ,options = {};

                othis.css('background-color', '#4958b9').siblings().removeAttr('style');
                var val = othis.data('value');
                console.info("value",val);
                $(".div_his").addClass("layui-hide");
                $("."+val).removeClass("layui-hide");
            }
        };
        setTimeout(function () {
            $('.bn_group_btns .layui-btn').off();
            $('.bn_group_btns .layui-btn').on('click', function(){
                console.info("bn_group_btns clicks")
                var othis = $(this), type = othis.data('type');
                console.info(othis)
                active[type] ? active[type].call(this, othis) : '';
            });
        },500);
        
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    
    function disPlayJyNode(nodeJyPara,nodeEn){
        console.info("nodeJyPara",JSON.stringify(nodeJyPara));
        vm_jy.node_jy_para = nodeJyPara;

        var form_node_jy_param = {};
        form_node_jy_param["_Enable"] = nodeEn>0?"on":"";
        
        form.val("form_node_jy_param",form_node_jy_param);
        vm_jy.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    //转换保护时间单位为秒
    function changePUnitSeconds(){
        for(var i=0;i<vm.Pg_para.length;i++){
            vm.Pg_para[i].Pg_wgapTime =Math.round(vm.Pg_para[i].Pg_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.La_para.length;i++){
            vm.La_para[i].La_wgapTime = Math.round(vm.La_para[i].La_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.Nr_para.length;i++){
            vm.Nr_para[i].Nr_fgapTime = Math.round(vm.Nr_para[i].Nr_fgapTime * 60).toString();
            vm.Nr_para[i].Nr_wgapTime = Math.round(vm.Nr_para[i].Nr_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.Fat_para.length;i++){
            vm.Fat_para[i].Fat_fgapTime = Math.round(vm.Fat_para[i].Fat_fgapTime * 60).toString();
            vm.Fat_para[i].Fat_wgapTime = Math.round(vm.Fat_para[i].Fat_wgapTime * 60).toString();
        }

        vm.Tmr_para.Tmr_wgapTime = Math.round(vm.Tmr_para.Tmr_wgapTime * 60).toString();

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }

    //转换保护时间单位为分钟
    function changePUnitMinute(){
        for(var i=0;i<vm.Pg_para.length;i++){
            vm.Pg_para[i].Pg_wgapTime = Math.round(vm.Pg_para[i].Pg_wgapTime / 60).toString();
            if(vm.Pg_para[i].Pg_wgapTime<1){
                vm.Pg_para[i].Pg_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.La_para.length;i++){
            vm.La_para[i].La_wgapTime = Math.round(vm.La_para[i].La_wgapTime / 60).toString();
            if(vm.La_para[i].La_wgapTime<1){
                vm.La_para[i].La_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.Nr_para.length;i++){
            vm.Nr_para[i].Nr_fgapTime = Math.round(vm.Nr_para[i].Nr_fgapTime / 60).toString();
            vm.Nr_para[i].Nr_wgapTime = Math.round(vm.Nr_para[i].Nr_wgapTime / 60).toString();
            if(vm.Nr_para[i].Nr_fgapTime<1){
                vm.Nr_para[i].Nr_fgapTime = 1;
            }
            if(vm.Nr_para[i].Nr_wgapTime<1){
                vm.Nr_para[i].Nr_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.Fat_para.length;i++){
            vm.Fat_para[i].Fat_fgapTime = Math.round(vm.Fat_para[i].Fat_fgapTime / 60).toString();
            vm.Fat_para[i].Fat_wgapTime = Math.round(vm.Fat_para[i].Fat_wgapTime / 60).toString();
            if(vm.Fat_para[i].Fat_fgapTime<1){
                vm.Fat_para[i].Fat_fgapTime = 1;
            }
            if(vm.Fat_para[i].Fat_wgapTime<1){
                vm.Fat_para[i].Fat_wgapTime = 1;
            }
        }

        vm.Tmr_para.Tmr_wgapTime = Math.round(vm.Tmr_para.Tmr_wgapTime / 60).toString();
        if(vm.Tmr_para.Tmr_wgapTime<1){
            vm.Tmr_para.Tmr_wgapTime= 1;
        }

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    
    function onSave(){
        console.info("onSave");
        if(!selectedTreeNode || selectedTreeNode.type=="DMXFGW"){
            $("#btn_save_param").click();
        }else if(selectedTreeNode.type == 'feed' || selectedTreeNode.type == 'fg'){
            saveNodePara();
        }else if(selectedTreeNode.type == 'bn'){
            saveNodeBnPara();
        }else if(selectedTreeNode.type == 'jy'){
            saveNodeJyPara();
        }
    }

    function onSaveAsPlan(){
        form.val("form_plan",{name:''});
        layer.open({
            //area: 'auto',
            area:['400px','200px'],
            type: 1,
            shade: 0.3,
            offset: '15%',
            shadeClose:true,
            title: '另存为', //不显示标题
            content: $('#form_plan'), //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
            btn: ['确定', '取消']
            ,yes: function(index, layero){
                lay_index=index;
                var submit = layero.find("#btn_save_plan");
                submit.click();
            }
        });
    }

    function doSavePlan(field){
        //方案参数
        var form_plan = form.val("form_plan");

        //基本参数获取
        var form_node_param = form.val("form_node_param");
        var enable = (form_node_param._Enable=="on"?"1":"0");
        vm.node_para.EnWater = (form_node_param._EnWater=="on"?"1":"0");
        vm.node_para.EnTB = (form_node_param._EnTB=="on"?"1":"0");
        
        vm.node_para.Mode = form_node_param.Mode;
        console.info(form_node_param);

        //妊娠
        for(var i=0;i<vm.Pg_para.length;i++)
        {
            vm.node_para.Pg_gday[i] = vm.Pg_para[i].Pg_gday;
            //处理时间
            var time = vm.Pg_para[i].Pg_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Pg_startT[i][x] = "00:00";
                    vm.node_para.Pg_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Pg_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Pg_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.Pg_outT[i] = vm.Pg_para[i].Pg_outT;
            vm.node_para.Pg_waterFeed[i] = vm.Pg_para[i].Pg_waterFeed;
            vm.node_para.Pg_firstFeed[i] = vm.Pg_para[i].Pg_firstFeed;
            vm.node_para.Pg_ftbFeed[i] = vm.Pg_para[i].Pg_ftbFeed;
            vm.node_para.Pg_tbFeed[i] = vm.Pg_para[i].Pg_tbFeed;
            vm.node_para.Pg_wgapTime[i] = vm.Pg_para[i].Pg_wgapTime;
            vm.node_para.Pg_cw[i] = vm.Pg_para[i].Pg_cw;
            vm.node_para.Pg_autoFeed[i] = vm.Pg_para[i].Pg_autoFeed;
            vm.node_para.Pg_fgapTime[i] = vm.Pg_para[i].Pg_fgapTime;
            vm.node_para.Pg_flag_bits[i] = vm.Pg_para[i].Pg_flag_bits;
            vm.node_para.Pg_flag[i] = vm.Pg_para[i].Pg_flag;
        }


        //哺乳
        for(var i=0;i<vm.La_para.length;i++)
        {
            vm.node_para.La_gday[i] = vm.La_para[i].La_gday;
            //处理时间
            var time = vm.La_para[i].La_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.La_startT[i][x] = "00:00";
                    vm.node_para.La_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.La_startT[i][x] = time_arr[0].trim();
                    vm.node_para.La_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.La_outT[i] = vm.La_para[i].La_outT;
            vm.node_para.La_waterFeed[i] = vm.La_para[i].La_waterFeed;
            vm.node_para.La_firstFeed[i] = vm.La_para[i].La_firstFeed;
            vm.node_para.La_ftbFeed[i] = vm.La_para[i].La_ftbFeed;
            vm.node_para.La_tbFeed[i] = vm.La_para[i].La_tbFeed;
            vm.node_para.La_wgapTime[i] = vm.La_para[i].La_wgapTime;
            vm.node_para.La_cw[i] = vm.La_para[i].La_cw;
            vm.node_para.La_autoFeed[i] = vm.La_para[i].La_autoFeed;
            vm.node_para.La_fgapTime[i] = vm.La_para[i].La_fgapTime;
            vm.node_para.La_flag_bits[i] = vm.La_para[i].La_flag_bits;
            vm.node_para.La_flag[i] = vm.La_para[i].La_flag;
        }

        //保育
        for(var i=0;i<vm.Nr_para.length;i++)
        {
            vm.node_para.Nr_gday[i] = vm.Nr_para[i].Nr_gday;
            //处理时间
            var time = vm.Nr_para[i].Nr_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Nr_startT[i][x] = "00:00";
                    vm.node_para.Nr_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Nr_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Nr_endT[i][x] = time_arr[1].trim();
                }
                
            }
            vm.node_para.Nr_waterFeed[i] = vm.Nr_para[i].Nr_waterFeed;
            vm.node_para.Nr_autoFeed[i] = vm.Nr_para[i].Nr_autoFeed;
            vm.node_para.Nr_fgapTime[i] = vm.Nr_para[i].Nr_fgapTime;
            vm.node_para.Nr_wgapTime[i] = vm.Nr_para[i].Nr_wgapTime;
            vm.node_para.Nr_cw[i] = vm.Nr_para[i].Nr_cw;
            vm.node_para.Nr_flag[i] = vm.Nr_para[i].Nr_flag;
        }

        //育肥
        for(var i=0;i<vm.Fat_para.length;i++)
        {
            vm.node_para.Fat_gday[i] = vm.Fat_para[i].Fat_gday;
            //处理时间
            var time = vm.Fat_para[i].Fat_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Fat_startT[i][x] = "00:00";
                    vm.node_para.Fat_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Fat_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Fat_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.Fat_waterFeed[i] = vm.Fat_para[i].Fat_waterFeed;
            vm.node_para.Fat_autoFeed[i] = vm.Fat_para[i].Fat_autoFeed;
            vm.node_para.Fat_fgapTime[i] = vm.Fat_para[i].Fat_fgapTime;
            vm.node_para.Fat_wgapTime[i] = vm.Fat_para[i].Fat_wgapTime;
            vm.node_para.Fat_cw[i] = vm.Fat_para[i].Fat_cw;
            vm.node_para.Fat_flag[i] = vm.Fat_para[i].Fat_flag;
        }

        //定时
        for(var i=0;i<vm.Tmr_para.Tmr_time.length;i++)
        {
            if(vm.Tmr_para.Tmr_time[i]==""){
                vm.node_para.Tmr_startT[i] = "00:00";
                vm.node_para.Tmr_endT[i] = "00:00";
            }
            else{
                var time_arr = vm.Tmr_para.Tmr_time[i].split("-");
                vm.node_para.Tmr_startT[i] = time_arr[0].trim();
                vm.node_para.Tmr_endT[i] = time_arr[1].trim();
            }
            
        }
        vm.node_para.Tmr_outT = vm.Tmr_para.Tmr_outT;
        vm.node_para.Tmr_waterFeed = vm.Tmr_para.Tmr_waterFeed;
        vm.node_para.Tmr_wgapTime = vm.Tmr_para.Tmr_wgapTime;
        vm.node_para.Tmr_cw = vm.Tmr_para.Tmr_cw;
        vm.node_para.Tmr_flag = vm.Tmr_para.Tmr_flag;
        vm.node_para.Tmr_flag_bits = vm.Tmr_para.Tmr_flag_bits;
        if(form_node_param._EnAutoSwitchGrowthMode=="on"){
            vm.node_para.Tmr_flag_bits[1] = true;
        }else{
            vm.node_para.Tmr_flag_bits[1] = false;
        }
        // if(form_node_param._EnFirstTouchAsFirstFeed=="on"){
        //     vm.node_para.Tmr_flag_bits[2] = true;
        // }else{
        //     vm.node_para.Tmr_flag_bits[2] = false;
        // }
        vm.node_para.Tmr_flag_bits[2] = true; //20240715 先默认打开且隐藏首次触碰当诱食处理

        if(form_node_param._EnMotorCurProtect=="on"){
            vm.node_para.Tmr_flag_bits[3] = false;
        }else{
            vm.node_para.Tmr_flag_bits[3] = true;
        }
        if(form_node_param._EnMotorCurIdle=="on"){
            vm.node_para.Tmr_flag_bits[4] = true;
        }else{
            vm.node_para.Tmr_flag_bits[4] = false;
        }
        console.info(vm.node_para.Tmr_flag_bits);

        
        vm.node_para.Sn = 99999999;
        vm.node_para.Gday = 1;
        //return;
        console.info(JSON.stringify(vm.node_para));

        layer.load(1);
        $.ajax({
            type: "POST",
            url: '../Api/FeedPlanNew',
            data: {para:JSON.stringify(vm.node_para),name:form_plan.name,food_plan:"",food_type:""},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                //console.info(data)
                if(res.code>=0){
                    toastr.success("保存成功");
                    //layui.table.reload('table'); //重载表格
                    layer.close(lay_index); //再执行关闭
                }else{
                    toastr.warning(res.msg, "异常");
                    //layer.alert('保存失败:'+data.msg);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert('保存失败');
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            }
        });
    }

    function onRefresh(){
        loadPara(request);
    }

    function onResetNode(){
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;
        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/ResetNodeParam',
            data: {addr:addr,tn:tn,enable:0},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        //layer.close(lay_index);
                        toastr.success(res.msg);
                        setTimeout(function(){onRefresh();},1000);
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }

    function onReloadQrcode(){
        console.info(selectedTreeNode);
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;
        var nodePara = czqPara.NodeParas[tn];
        var sn = nodePara.Sn;
        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/Qrcode',
            data: {addr:addr,tn:tn,sn:sn,type:selectedTreeNode.type},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        //layer.close(lay_index);
                        toastr.success(res.msg);
                        //setTimeout(function(){onRefresh();},1000);
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }

    function onClearRecord(){
        var addr = czqPara.Addr;
        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/ClearRecord',
            data: {addr:addr},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        //layer.close(lay_index);
                        toastr.success(res.msg);
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }

    function saveNodePara(){
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;

        //基本参数获取
        var form_node_param = form.val("form_node_param");
        var enable = (form_node_param._Enable=="on"?"1":"0");
        vm.node_para.EnWater = (form_node_param._EnWater=="on"?"1":"0");
        vm.node_para.EnTB = (form_node_param._EnTB=="on"?"1":"0");
        vm.node_para.Mode = form_node_param.Mode;
        console.info(form_node_param);

        //妊娠
        for(var i=0;i<vm.Pg_para.length;i++)
        {
            vm.node_para.Pg_gday[i] = vm.Pg_para[i].Pg_gday;
            //处理时间
            var time = vm.Pg_para[i].Pg_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Pg_startT[i][x] = "00:00";
                    vm.node_para.Pg_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Pg_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Pg_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.Pg_outT[i] = vm.Pg_para[i].Pg_outT;
            vm.node_para.Pg_waterFeed[i] = vm.Pg_para[i].Pg_waterFeed;
            vm.node_para.Pg_firstFeed[i] = vm.Pg_para[i].Pg_firstFeed;
            vm.node_para.Pg_ftbFeed[i] = vm.Pg_para[i].Pg_ftbFeed;
            vm.node_para.Pg_tbFeed[i] = vm.Pg_para[i].Pg_tbFeed;
            vm.node_para.Pg_wgapTime[i] = vm.Pg_para[i].Pg_wgapTime;
            vm.node_para.Pg_cw[i] = vm.Pg_para[i].Pg_cw;
            vm.node_para.Pg_autoFeed[i] = vm.Pg_para[i].Pg_autoFeed;
            vm.node_para.Pg_fgapTime[i] = vm.Pg_para[i].Pg_fgapTime;
            vm.node_para.Pg_flag_bits[i] = vm.Pg_para[i].Pg_flag_bits;
            vm.node_para.Pg_flag[i] = vm.Pg_para[i].Pg_flag;
            vm.node_para.Pg_rev_bits[i] = vm.Pg_para[i].Pg_rev_bits;
            vm.node_para.Pg_rev[i] = vm.Pg_para[i].Pg_rev;
        }


        //哺乳
        for(var i=0;i<vm.La_para.length;i++)
        {
            vm.node_para.La_gday[i] = vm.La_para[i].La_gday;
            //处理时间
            var time = vm.La_para[i].La_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.La_startT[i][x] = "00:00";
                    vm.node_para.La_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.La_startT[i][x] = time_arr[0].trim();
                    vm.node_para.La_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.La_outT[i] = vm.La_para[i].La_outT;
            vm.node_para.La_waterFeed[i] = vm.La_para[i].La_waterFeed;
            vm.node_para.La_firstFeed[i] = vm.La_para[i].La_firstFeed;
            vm.node_para.La_ftbFeed[i] = vm.La_para[i].La_ftbFeed;
            vm.node_para.La_tbFeed[i] = vm.La_para[i].La_tbFeed;
            vm.node_para.La_wgapTime[i] = vm.La_para[i].La_wgapTime;
            vm.node_para.La_cw[i] = vm.La_para[i].La_cw;
            vm.node_para.La_autoFeed[i] = vm.La_para[i].La_autoFeed;
            vm.node_para.La_fgapTime[i] = vm.La_para[i].La_fgapTime;
            vm.node_para.La_flag_bits[i] = vm.La_para[i].La_flag_bits;
            vm.node_para.La_flag[i] = vm.La_para[i].La_flag;
            vm.node_para.La_rev_bits[i] = vm.La_para[i].La_rev_bits;
            vm.node_para.La_rev[i] = vm.La_para[i].La_rev;
        }

        //保育
        for(var i=0;i<vm.Nr_para.length;i++)
        {
            vm.node_para.Nr_gday[i] = vm.Nr_para[i].Nr_gday;
            //处理时间
            var time = vm.Nr_para[i].Nr_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Nr_startT[i][x] = "00:00";
                    vm.node_para.Nr_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Nr_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Nr_endT[i][x] = time_arr[1].trim();
                }
                
            }
            vm.node_para.Nr_waterFeed[i] = vm.Nr_para[i].Nr_waterFeed;
            vm.node_para.Nr_autoFeed[i] = vm.Nr_para[i].Nr_autoFeed;
            vm.node_para.Nr_fgapTime[i] = vm.Nr_para[i].Nr_fgapTime;
            vm.node_para.Nr_wgapTime[i] = vm.Nr_para[i].Nr_wgapTime;
            vm.node_para.Nr_cw[i] = vm.Nr_para[i].Nr_cw;
            vm.node_para.Nr_flag_bits[i] = vm.Nr_para[i].Nr_flag_bits;
            vm.node_para.Nr_flag[i] = vm.Nr_para[i].Nr_flag;
        }

        //育肥
        for(var i=0;i<vm.Fat_para.length;i++)
        {
            vm.node_para.Fat_gday[i] = vm.Fat_para[i].Fat_gday;
            //处理时间
            var time = vm.Fat_para[i].Fat_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Fat_startT[i][x] = "00:00";
                    vm.node_para.Fat_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Fat_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Fat_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.Fat_waterFeed[i] = vm.Fat_para[i].Fat_waterFeed;
            vm.node_para.Fat_autoFeed[i] = vm.Fat_para[i].Fat_autoFeed;
            vm.node_para.Fat_fgapTime[i] = vm.Fat_para[i].Fat_fgapTime;
            vm.node_para.Fat_wgapTime[i] = vm.Fat_para[i].Fat_wgapTime;
            vm.node_para.Fat_cw[i] = vm.Fat_para[i].Fat_cw;
            vm.node_para.Fat_flag_bits[i] = vm.Fat_para[i].Fat_flag_bits;
            vm.node_para.Fat_flag[i] = vm.Fat_para[i].Fat_flag;
        }

        //定时
        for(var i=0;i<vm.Tmr_para.Tmr_time.length;i++)
        {
            if(vm.Tmr_para.Tmr_time[i]==""){
                vm.node_para.Tmr_startT[i] = "00:00";
                vm.node_para.Tmr_endT[i] = "00:00";
            }
            else{
                var time_arr = vm.Tmr_para.Tmr_time[i].split("-");
                vm.node_para.Tmr_startT[i] = time_arr[0].trim();
                vm.node_para.Tmr_endT[i] = time_arr[1].trim();
            }
            
        }
        vm.node_para.Tmr_outT = vm.Tmr_para.Tmr_outT;
        vm.node_para.Tmr_waterFeed = vm.Tmr_para.Tmr_waterFeed;
        vm.node_para.Tmr_wgapTime = vm.Tmr_para.Tmr_wgapTime;
        vm.node_para.Tmr_cw = vm.Tmr_para.Tmr_cw;
        vm.node_para.Tmr_flag = vm.Tmr_para.Tmr_flag;
        vm.node_para.Tmr_flag_bits = vm.Tmr_para.Tmr_flag_bits;
        if(form_node_param._EnAutoSwitchGrowthMode=="on"){
            vm.node_para.Tmr_flag_bits[1] = true;
        }else{
            vm.node_para.Tmr_flag_bits[1] = false;
        }
        if(form_node_param._EnFirstTouchAsFirstFeed=="on"){
            vm.node_para.Tmr_flag_bits[2] = true;
        }else{
            vm.node_para.Tmr_flag_bits[2] = false;
        }
        if(form_node_param._EnMotorCurProtect=="on"){
            vm.node_para.Tmr_flag_bits[3] = false;
        }else{
            vm.node_para.Tmr_flag_bits[3] = true;
        }
        if(form_node_param._EnMotorCurIdle=="on"){
            vm.node_para.Tmr_flag_bits[4] = true;
        }else{
            vm.node_para.Tmr_flag_bits[4] = false;
        }
        if(vm.wp_unit>0){
            vm.node_para.Tmr_flag_bits[5] = true;
        }else{
            vm.node_para.Tmr_flag_bits[5] = false;
        }
        console.info(vm.node_para.Tmr_flag_bits);
        console.info(JSON.stringify(vm.node_para));

        //校验部分数据
        var err='';
        if(vm.wp_unit==1)
        {
            for(var i=0;i<vm.node_para.Pg_wgapTime.length;i++){
                if(vm.node_para.Pg_gday[i]>0){
                    if(vm.node_para.Pg_wgapTime[i]<10){
                        err = "妊娠模式下水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.La_wgapTime.length;i++){
                if(vm.node_para.La_gday[i]>0){
                    if(vm.node_para.La_wgapTime[i]<10){
                        err = "哺乳模式下水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Nr_fgapTime.length;i++){
                if(vm.node_para.Nr_gday[i]>0){
                    if(vm.node_para.Nr_fgapTime[i]<10){
                        err = "保育模式自动出料时间保护不能小于10秒"
                        break;
                    }
                    if(vm.node_para.Nr_wgapTime[i]<10){
                        err = "保育模式自动出水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Fat_fgapTime.length;i++){
                if(vm.node_para.Fat_gday[i]>0){
                    if(vm.node_para.Fat_fgapTime[i]<10){
                        err = "育肥模式自动出料时间保护不能小于10秒"
                        break;
                    }
                    if(vm.node_para.Fat_wgapTime[i]<10){
                        err = "育肥模式自动出水保护时间不能小于10秒"
                        break;
                    }
                }
            }
        }

        if(err!=""){
            layer.alert(err);
            return;
        }
        


        //兼容 粥料器
        var url = '../Api/Device/HZFGWN/NodeParam';
        if(vm.model == "168"){
            if(vm.node_para.Mode == "0"){
                vm.node_para.Mode = "0";
            }else if(vm.node_para.Mode == "3"){
                vm.node_para.Mode = "1";
            }else if(vm.node_para.Mode == "4"){
                vm.node_para.Mode = "2";
            }else if(vm.node_para.Mode == "5"){
                vm.node_para.Mode = 3;
            }
            url = '../Api/Device/Gw/NodeFgParam';
        }else{
            url = '../Api/Device/Gw/NodeParam';
        }

        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: url,
            data: {addr:addr,tn:tn,enable:enable,params:JSON.stringify(vm.node_para)},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        layer.close(lay_index);
                        toastr.success(res.msg);
                        
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
        
    }

    function saveNodeBnPara(){
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;

        //基本参数获取
        var form_node_bn_param = form.val("form_node_bn_param");
        var enable = (form_node_bn_param._Enable=="on"?"1":"0");

        var form_node_bn_group_param = form.val("form_node_bn_group_param");
        vm_bn.node_bn_para.Mode[0] = form_node_bn_group_param.Mode0;
        vm_bn.node_bn_para.Mode[1] = form_node_bn_group_param.Mode1;
        console.info(form_node_bn_group_param);

        for(var x=0;x<2;x++){
            console.info(JSON.stringify(vm_bn.bn_para[x]));
            for(var i=0;i<vm_bn.bn_para[x].length;i++){
                
                //处理时间
                var time = vm_bn.bn_para[x][i].Bn_time;
                
                for(var j=0;j<time.length;j++)
                {
                    if(time[j]==""){
                        vm_bn.node_bn_para.Bn_startT[x][i][j] = "00:00";
                        vm_bn.node_bn_para.Bn_endT[x][i][j] = "00:00";
                    }
                    else{
                        var time_arr = time[j].split("-");
                        vm_bn.node_bn_para.Bn_startT[x][i][j] = time_arr[0].trim();
                        vm_bn.node_bn_para.Bn_endT[x][i][j] = time_arr[1].trim();
                    }
                }
                vm_bn.node_bn_para.Bn_gday[x][i] = vm_bn.bn_para[x][i].Bn_gday;
                vm_bn.node_bn_para.Bn_fgapTime[x][i] = vm_bn.bn_para[x][i].Bn_fgapTime;
                vm_bn.node_bn_para.Bn_flag[x][i] = vm_bn.bn_para[x][i].Bn_flag;
            }
        }

        var params = JSON.stringify(vm_bn.node_bn_para);
        console.info(params);

        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/NodeBnParam',
            data: {addr:addr,tn:tn,enable:enable,params:params},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        layer.close(lay_index);
                        toastr.success(res.msg);
                        
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }

    function saveNodeJyPara(){
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;

        //基本参数获取
        var form_node_jy_param = form.val("form_node_jy_param");
        var enable = (form_node_jy_param._Enable=="on"?"1":"0");
        vm_jy.node_jy_para.Mode = form_node_jy_param.Mode;


        var params = JSON.stringify(vm_jy.node_jy_para);
        console.info(params);

        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/NodeJyParam',
            data: {addr:addr,tn:tn,enable:enable,params:params},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        layer.close(lay_index);
                        toastr.success(res.msg);
                        
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }

    //清空对应模式下方案参数
    function onClearAll(){
        console.info(vm.mode);
        //妊娠
        if(vm.mode==EMODE_PG_NEW){
            for(var i=0;i<vm.Pg_para.length;i++)
            {
                
                for(var x=0;x<vm.Pg_para[i].Pg_time.length;x++){
                    vm.Pg_para[i].Pg_time[x]="00:00 - 00:00";
                    //vm.Pg_para[i].Pg_startT[x]="00:00";
                    //vm.Pg_para[i].Pg_endT[x]="00:00";
                    vm.Pg_para[i].Pg_outT[x]="0";
                }
                vm.Pg_para[i].Pg_gday = "0";
                vm.Pg_para[i].Pg_waterFeed = "0";
                vm.Pg_para[i].Pg_firstFeed = "0";
                vm.Pg_para[i].Pg_ftbFeed = "0";
                vm.Pg_para[i].Pg_tbFeed = "0";
                vm.Pg_para[i].Pg_wgapTime = "0";
                vm.Pg_para[i].Pg_cw = "0";
                vm.Pg_para[i].Pg_autoFeed = "0";
                vm.Pg_para[i].Pg_fgapTime = "0";
                vm.Pg_para[i].Pg_flag = "0";

                vm.Pg_para[i].Pg_feed_num = "0";
                vm.Pg_para[i].Pg_total_feed = "0";
            }
        }
        else if(vm.mode==EMODE_LACTATION_NEW){
            for(var i=0;i<vm.La_para.length;i++)
            {
                
                for(var x=0;x<vm.La_para[i].La_time.length;x++){
                    vm.La_para[i].La_time[x]="00:00 - 00:00";
                    //vm.La_para[i].La_startT[x]="00:00";
                    //vm.La_para[i].La_endT[x]="00:00";
                    vm.La_para[i].La_outT[x]="0";
                }
                vm.La_para[i].La_gday = "0";
                vm.La_para[i].La_waterFeed = "0";
                vm.La_para[i].La_firstFeed = "0";
                vm.La_para[i].La_ftbFeed = "0";
                vm.La_para[i].La_tbFeed = "0";
                vm.La_para[i].La_wgapTime = "0";
                vm.La_para[i].La_cw = "0";
                vm.La_para[i].La_autoFeed = "0";
                vm.La_para[i].La_fgapTime = "0";
                vm.La_para[i].La_flag = "0";

                vm.La_para[i].La_feed_num = "0";
                vm.La_para[i].La_total_feed = "0";
            }
        }
        else if(vm.mode==EMODE_NURSE_NEW){
            for(var i=0;i<vm.Nr_para.length;i++)
            {
                
                for(var x=0;x<vm.Nr_para[i].Nr_time.length;x++){
                    vm.Nr_para[i].Nr_time[x]="00:00 - 00:00";
                    //vm.Nr_para[i].Nr_startT[x]="00:00";
                    //vm.Nr_para[i].Nr_endT[x]="00:00";
                }
                vm.Nr_para[i].Nr_gday = "0";
                vm.Nr_para[i].Nr_waterFeed = "0";
                vm.Nr_para[i].Nr_autoFeed = "0";
                vm.Nr_para[i].Nr_fgapTime = "0";
                vm.Nr_para[i].Nr_wgapTime = "0";
                vm.Nr_para[i].Nr_cw = "0";
                vm.Nr_para[i].Nr_flag = "0";
            }
        }
        else if(vm.mode==EMODE_FAT_NEW){
            for(var i=0;i<vm.Fat_para.length;i++)
            {
                
                for(var x=0;x<vm.Fat_para[i].Fat_time.length;x++){
                    vm.Fat_para[i].Fat_time[x]="00:00 - 00:00";
                    //vm.Fat_para[i].Fat_startT[x]="00:00";
                    //vm.Fat_para[i].Fat_endT[x]="00:00";
                }
                vm.Fat_para[i].Fat_gday = "0";
                vm.Fat_para[i].Fat_waterFeed = "0";
                vm.Fat_para[i].Fat_autoFeed = "0";
                vm.Fat_para[i].Fat_fgapTime = "0";
                vm.Fat_para[i].Fat_wgapTime = "0";
                vm.Fat_para[i].Fat_cw = "0";
                vm.Fat_para[i].Fat_flag = "0";
            }
        }
        else if(vm.mode==EMODE_TIMER_NEW){
            for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++)
            {
                vm.Tmr_para.Tmr_time[x]="00:00 - 00:00";
                vm.Tmr_para.Tmr_outT[x]="0";
            }
            vm.Tmr_para.Tmr_waterFeed = "0";
            vm.Tmr_para.Tmr_wgapTime = "0";
            vm.Tmr_para.Tmr_cw = "0";
            vm.Tmr_para.Tmr_flag = "0";

            vm.Tmr_para.Tmr_feed_num = "0";
            vm.Tmr_para.Tmr_total_feed = "0";
        }

        vm.$forceUpdate();
    }


    function onClearLine(item,i){
        console.info(item,i);
        if(vm.mode==EMODE_PG_NEW){
            for(var x=0;x<vm.Pg_para[i].Pg_time.length;x++){
                vm.Pg_para[i].Pg_time[x]="00:00 - 00:00";
                //vm.Pg_para[i].Pg_startT[x]="00:00";
                //vm.Pg_para[i].Pg_endT[x]="00:00";
                vm.Pg_para[i].Pg_outT[x]="0";
            }
            vm.Pg_para[i].Pg_gday = "0";
            vm.Pg_para[i].Pg_waterFeed = "0";
            vm.Pg_para[i].Pg_firstFeed = "0";
            vm.Pg_para[i].Pg_ftbFeed = "0";
            vm.Pg_para[i].Pg_tbFeed = "0";
            vm.Pg_para[i].Pg_wgapTime = "0";
            vm.Pg_para[i].Pg_cw = "0";
            vm.Pg_para[i].Pg_autoFeed = "0";
            vm.Pg_para[i].Pg_fgapTime = "0";
            vm.Pg_para[i].Pg_flag = "0";

            vm.Pg_para[i].Pg_feed_num = "0";
            vm.Pg_para[i].Pg_total_feed = "0";
        }
        else if(vm.mode==EMODE_LACTATION_NEW){
            for(var x=0;x<vm.La_para[i].La_time.length;x++){
                vm.La_para[i].La_time[x]="00:00 - 00:00";
                //vm.La_para[i].La_startT[x]="00:00";
                //vm.La_para[i].La_endT[x]="00:00";
                vm.La_para[i].La_outT[x]="0";
            }
            vm.La_para[i].La_gday = "0";
            vm.La_para[i].La_waterFeed = "0";
            vm.La_para[i].La_firstFeed = "0";
            vm.La_para[i].La_ftbFeed = "0";
            vm.La_para[i].La_tbFeed = "0";
            vm.La_para[i].La_wgapTime = "0";
            vm.La_para[i].La_cw = "0";
            vm.La_para[i].La_autoFeed = "0";
            vm.La_para[i].La_fgapTime = "0";
            vm.La_para[i].La_flag = "0";

            vm.La_para[i].La_feed_num = "0";
            vm.La_para[i].La_total_feed = "0";
        }
        else if(vm.mode==EMODE_NURSE_NEW){
            for(var x=0;x<vm.Nr_para[i].Nr_time.length;x++){
                vm.Nr_para[i].Nr_time[x]="00:00 - 00:00";
                //vm.Nr_para[i].Nr_startT[x]="00:00";
                //vm.Nr_para[i].Nr_endT[x]="00:00";
            }
            vm.Nr_para[i].Nr_gday = "0";
            vm.Nr_para[i].Nr_waterFeed = "0";
            vm.Nr_para[i].Nr_autoFeed = "0";
            vm.Nr_para[i].Nr_fgapTime = "0";
            vm.Nr_para[i].Nr_wgapTime = "0";
            vm.Nr_para[i].Nr_cw = "0";
            vm.Nr_para[i].Nr_flag = "0";
        }
        else if(vm.mode==EMODE_FAT_NEW){
            for(var x=0;x<vm.Fat_para[i].Fat_time.length;x++){
                vm.Fat_para[i].Fat_time[x]="00:00 - 00:00";
                //vm.Fat_para[i].Fat_startT[x]="00:00";
                //vm.Fat_para[i].Fat_endT[x]="00:00";
            }
            vm.Fat_para[i].Fat_gday = "0";
            vm.Fat_para[i].Fat_waterFeed = "0";
            vm.Fat_para[i].Fat_autoFeed = "0";
            vm.Fat_para[i].Fat_fgapTime = "0";
            vm.Fat_para[i].Fat_wgapTime = "0";
            vm.Fat_para[i].Fat_cw = "0";
            vm.Fat_para[i].Fat_flag = "0";
        }
        else if(vm.mode==EMODE_TIMER_NEW){
            for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++)
            {
                vm.Tmr_para.Tmr_time[x]="00:00 - 00:00";
                vm.Tmr_para.Tmr_outT[x]="0";
            }
            vm.Tmr_para.Tmr_waterFeed = "0";
            vm.Tmr_para.Tmr_wgapTime = "0";
            vm.Tmr_para.Tmr_cw = "0";
            vm.Tmr_para.Tmr_flag = "0";

            vm.Tmr_para.Tmr_feed_num = "0";
            vm.Tmr_para.Tmr_total_feed = "0";
        }
        vm.$forceUpdate();
    }

    //使用对应模式下方案默认参数
    function onApplyDefault(){
        //toastr.warning( "功能待开发");
        var nodePara = czqPara.NodeParas[selectedTreeNode.idx];

        var Sn = nodePara.Sn;
        var Passwd = nodePara.Passwd;
        var Gday = nodePara.Gday;
        var Hnum = nodePara.Hnum;
        var Mode = vm.mode;
        nodePara =JSON.parse(JSON.stringify(DEFAULT_ITEM_PARA));
        nodePara.Sn = Sn;
        nodePara.Passwd = Passwd;
        nodePara.Gday = Gday;
        nodePara.Hnum = Hnum;
        nodePara.Mode = Mode;

        var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];
        disPlayNode(nodePara,nodeEn);
        toastr.success("应用默认参数成功");
    }

    function onCopyNode(){
        var nodePara = czqPara.NodeParas[selectedTreeNode.idx];
        copy_node_para_str = JSON.stringify(nodePara);
        toastr.success(nodePara.Sn+" 参数复制成功");
    }

    function onApplyNode(){
        if(copy_node_para_str){
            var nodePara = czqPara.NodeParas[selectedTreeNode.idx];
            var nodeEn = czqPara.NodeEn[selectedTreeNode.idx];

            var copy_node_para = JSON.parse(copy_node_para_str);

            var Sn = nodePara.Sn;
            var Hnum = nodePara.Hnum;

            nodePara = copy_node_para;
            nodePara.Sn = Sn;
            nodePara.Hnum = Hnum;

            disPlayNode(nodePara,nodeEn);
            toastr.success("应用参数成功");

        }else{
            toastr.warning("尚未复制参数", "提示");
        }
    }
    
    function autoCreateHnum(){
        
        //console.info(request.default_hnum_prefix,selectedTreeNode.idx);
        var hnum = (selectedTreeNode.idx+1).toString();
        console.info(hnum);
        $("#Hnum").val(hnum);
        //var nodePara = czqPara.NodeParas[selectedTreeNode.idx];
        //nodePara.Hnum = hnum;
        toastr.success("栏位号:"+hnum+"已填写");
    }
    
    function onSetHnum(){
        var addr = czqPara.Addr;
        var tn = selectedTreeNode.idx;
        //var nodePara = czqPara.NodeParas[selectedTreeNode.idx];
        var hnum = vm.node_para.Hnum;
        console.info(addr,tn,hnum);
        layer.load(1);
        $.ajax({
            type: 'PUT',
            url: '../Api/Device/Gw/SetNodeHnum',
            data: {addr:addr,tn:tn,hnum:hnum},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            success: function(res){
                if(res){
                    if(res.code>=0){
                        //保存成功
                        layer.close(lay_index);
                        toastr.success(res.msg);
                        
                    }else{
                        //layer.alert(res.msg);
                        toastr.warning(res.msg, "异常");
                    }
                }
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
            dataType: "json"
        });
    }
    
    
    String.prototype.PadLeft = function (len, charStr) {
        var s = this + '';
    return new Array(len - s.length + 1).join(charStr || '') + s;
    }
    String.prototype.PadRight = function (len, charStr) {
        var s = this + '';
    return s + new Array(len - s.length + 1).join(charStr || '');
    }

    //设置图标
    function setDataIcon(data){

        for(let i=0; i<data.length; i++){
            var node=data[i];

            node['font']={'color':'#333'};
            if(node.type=='root'){
                node.name = "";
                node["icon"]="../plugins/zTree/css/metroStyle/img/net.png";
                node.isParent=true;
            }
            else if(node.type=='farm'){
                node["icon"]="../plugins/zTree/css/metroStyle/img/location.png";
                node.isParent=true;
            }else if(node.type=='house'){
                node["icon"]="../plugins/zTree/css/metroStyle/img/house.png";
                node.isParent=false;
                if(node.device_online)
                {
                    node['font']={'color':'#3c7cff'};
                }else{
                    node['font']={'color':'#A3A8B6'};
                }
                //node['font']={'color':'#4958b9','font-weight':"bold"};
            }
            else if(node.type=='HZFGW') {
                node["icon"] = "../plugins/zTree/css/metroStyle/img/gw.png";
                node.isParent=false;
                node.open=true;
            }
            else if(node.type=='DMXFGW') {
                node["icon"] = "../plugins/zTree/css/metroStyle/img/gw.png";
                node.isParent=false;
                node.open=true;
            }
            else if(node.type=='hnum') {
                node["icon"] = "../plugins/zTree/css/metroStyle/img/farm.png";
                //node.isParent=false;
                //node.open=false;
                //node["isHidden"] = true;
            }
            else if(node.type=='feed' || node.type == 'bn'|| node.type == 'jy' || node.type == 'fg'){
                if(node.enable>0){
                    if(node.online>0){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                        node['font']={'color':'#3c7cff'};
                        if(node.alarm>0){
                            node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                            node['font']={'color':'#f29114'};
                        }
                    }else if(node.online==0){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node_offline.png";
                        node['font']={'color':'#333'};
                    }else if(node.online==-1){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                        node['font']={'color':'#333'};
                    }
                }else{
                    node["icon"]="../plugins/zTree/css/metroStyle/img/no.png";
                    node['font']={'color':'#333'};
                }

                node.isParent=false;
            }
            else if(node.type=='deliver'){
                if(node.enable>0){
                    if(node.online>0){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                        node['font']={'color':'#3c7cff'};
                        if(node.alarm>0){
                            node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                            node['font']={'color':'#f29114'};
                        }
                    }else if(node.online==0){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node_offline.png";
                        node['font']={'color':'#333'};
                    }else if(node.online==-1){
                        node["icon"]="../plugins/zTree/css/metroStyle/img/node.png";
                        node['font']={'color':'#fff'};
                    }
                }else{
                    node["icon"]="../plugins/zTree/css/metroStyle/img/no.png";
                    node['font']={'color':'#333'};
                }

                node.isParent=false;
            }
            if(node['children']){
                var data1=node.children;
                setDataIcon(data1);
            }
        }
        return data;
    }

    function onMaxSize(){
        var url = window.location.href;
        if(url.indexOf('?')>=0){
            url+="&max=1";
        }else{
            url+="?max=1";
        }
        console.info(url);
        window.open(url);
    }
    
    function resize() {
        var h = $(window).height();
        $("#tree").slimScroll({
            height: h-15,
            size: '4px', //组件宽度
            color: '#eee', //滚动条颜色
            position: 'right', //组件位置：left/right
            distance: '0px', //组件与侧边之间的距离
            start: 'top', //默认滚动位置：top/bottom
            opacity: .4, //滚动条透明度
            alwaysVisible: true, //是否 始终显示组件
            disableFadeOut: false, //是否 鼠标经过可滚动区域时显示组件，离开时隐藏组件
            railVisible: true, //是否 显示轨道
            railColor: '#333', //轨道颜色
            railOpacity: .2, //轨道透明度
            railDraggable: true, //是否 滚动条可拖动
            railClass: 'slimScrollRail', //轨道div类名
            barClass: 'slimScrollBar', //滚动条div类名
            wrapperClass: 'slimScrollDiv', //外包div类名
            allowPageScroll: true, //是否 使用滚轮到达顶端/底端时，滚动窗口
            wheelStep: 10, //滚轮滚动量
            touchScrollStep: 200, //滚动量当用户使用手势
            borderRadius: '7px', //滚动条圆角
            railBorderRadius: '7px' //轨道圆角
        });

        $(".right").slimScroll({
            height: h-65,
            size: '4px', //组件宽度
            color: '#eee', //滚动条颜色
            position: 'right', //组件位置：left/right
            distance: '0px', //组件与侧边之间的距离
            start: 'top', //默认滚动位置：top/bottom
            opacity: .4, //滚动条透明度
            alwaysVisible: true, //是否 始终显示组件
            disableFadeOut: false, //是否 鼠标经过可滚动区域时显示组件，离开时隐藏组件
            railVisible: true, //是否 显示轨道
            railColor: '#333', //轨道颜色
            railOpacity: .2, //轨道透明度
            railDraggable: true, //是否 滚动条可拖动
            railClass: 'slimScrollRail', //轨道div类名
            barClass: 'slimScrollBar', //滚动条div类名
            wrapperClass: 'slimScrollDiv', //外包div类名
            allowPageScroll: true, //是否 使用滚轮到达顶端/底端时，滚动窗口
            wheelStep: 10, //滚轮滚动量
            touchScrollStep: 200, //滚动量当用户使用手势
            borderRadius: '7px', //滚动条圆角
            railBorderRadius: '7px' //轨道圆角
        });
    }
    $(window).resize(function () {
        //console.info('resize')
        resize();
    });
    function formatminutes(date){
        $($(".laydate-time-list li ol")[2]).find("li").remove(); //清空秒
    }
</script>
<script src="../js/check_screen.js?v=${.Config.basic.version}"></script>

<form class="layui-form" lay-filter="form_plan" id="form_plan" style="padding: 20px;display:none;">
    <div class="layui-form-item layui-hide">
        <input type="text" name="addr" lay-verify="" placeholder="" autocomplete="off" class="layui-input" style="width: 100%">
        <input type="text" name="tn" lay-verify="" placeholder="" autocomplete="off" class="layui-input" style="width: 100%">
    </div>
    <!-- <div class="layui-form-mid layui-word-aux text-center layui-text-xs fr" style="width: 100%;"><i class="layui-text-xs layui-icon layui-icon-about"></i> 注意:填写为0则不执行</div> -->
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-label-sm"><span class="layui-text-red">*</span> 方案名称 </label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required"  lay-verType="tips" placeholder="" autocomplete="off" class="layui-input" style="width: 100%">
        </div>
        <!-- <label class="layui-form-label layui-form-label-xs" style="text-align: left;">g</label> -->
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="btn_save_plan" id="btn_save_plan" value="确认">
    </div>
</form>

</html>